A core database library used for personal projects
npm install @aneuhold/core-ts-db-lib

This is used to export types used in various places for database interactions in personal projects.
To add to a repo, follow the instructions below for your environment:
Run pnpm add @aneuhold/core-ts-db-lib
The below instructions still allow for things like Renovate to work, and normal commands with pnpm such as pnpm up.
1. Add the required JSR configuration to a .npmrc file if not there already:
```
@jsr:registry=https://npm.jsr.io
pnpm add @jsr/aneuhold__core-ts-db-lib
1. Add the package with
Run deno add jsr:@aneuhold/core-ts-db-lib
Pull in one of the services and use it like so:
`ts
import { DocumentService } from '@aneuhold/core-ts-db-lib';
// If using Node with JSR
// import { DocumentService } from '@jsr/aneuhold__core-ts-db-lib';
export default function deepCopy() {
DocumentService.deepCopy({ someProperty: 'someString' });
}
`
See full documentation on usage at JSR!
Project-specific documents can be held in a single collection. So those should inherit from the BaseDocumentWithType class.
When different document types are held under a specific collection, they should get their own folder.
> Note that documents cannot have really special types or classes with functions. For example Set cannot be used.
If a property is being moved or a new required property is added, then take the
following steps
1. Update the document
1. Update the validator
1. Push the changes to NPM
1. Go to be-ts-db-lib and update the versions there with pnpm upgrade:corepnpm migrate:dry
1. Update the migration service in that repo and double check it looks okay
1. Run the migration with then pnpm migratepnpm validate:dry
1. Run validation to ensure everything is alright with then pnpm validate if neededbe-ts-db-lib
1. Run tests
1. Update tests if needed then re-validate
1. Push a new version of the to NPMdigital-ocean-functions
1. Pull the new versions into and deploycore-ts-api-lib` and push to NPM
1. Pull the new versions into
1. Pull the new versions into any relevant frontends and deploy
1. Test out the frontends to make sure it works okay and double check MongoDB directly