SiLeBAT / mibi-portal-server

0 stars 1 forks source link

Parse: Prepare DB migration #295

Closed GerberI closed 1 year ago

GerberI commented 2 years ago

To migrate the DB to be compatible with parse, some research has to be done.

Object ids

Parse-server uses/requires type string for primary keys (attribute _id) in collections but our mongo db collections are using type ObjectId. ObjectIds can be auto created, string ids not.

Read: ObjectId in MongoDB

"created" and "updated" fields

createdAt and updatedAt fields should be renamed to _created_at and _updated_at because the parse-server uses these fields.

Revision keys

Avoid/Rename field names starting with '_' except the ones mentioned above. Currently only '__v' is used (auto created by mongoose as revision counter).

Read: versionKey in mongoose

Indexing

birgitlewicki commented 2 years ago

Results of this ticket are described at https://gitlab.bfr.berlin/devs43/common/parse-integration/-/wikis/Using-parse-server-with-existing-mongo-db-collections