From 0b7e1dce6d2384c0b6360358b650594d87da2737 Mon Sep 17 00:00:00 2001 From: Eric Burel Date: Mon, 3 Jan 2022 09:40:16 +0100 Subject: [PATCH] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 319905f..ba8b754 100644 --- a/README.md +++ b/README.md @@ -86,21 +86,21 @@ In the long run, the goal is to transition the Meteor backend to Next as well, u ### Reuse the meteor database +See this script: https://github.com/GraemeFulton/vulcan-next-meteor-mongo-migrate + + See https://github.com/VulcanJS/vulcan-npm/issues/63. Meteor uses string `_id` as a default, while Mongo uses `ObjectId` type, so you need to do `ObjectId.str` to get the actual id or use a method like `isEqual` from lodash. **This means that objects created using Next backend might create bugs in the Meteor backend**. You need to avoid that, by doing creation operations only in Meteor, or to clearly separate things you manage in Next and things you manage in Meteor until you have fully transitionned. ### Reuse existing user + - If you plan to reuse your existing Meteor database in Next, this means you might need to parse all documents and change the "string" `_id` to an `ObjectId`, see https://forums.meteor.com/t/convert-meteor-mongo-string--id-into-objectid/19782. You can change the `_id` generation scheme (see https://docs.meteor.com/api/collections.html) to ObjectId in the Meteor app if you need a progressive transition. TODO: We still have an issue with `function convertIdAndTransformToJSON`, it tries to access `document._id` for string conversion but it seems to be undefined when using a Meteor Mongo database. **Current workaround:**: clone users manually in Compass, it will recreate an id as an ObjectID https://docs.mongodb.com/compass/current/documents/clone/ **Better workaround**: force mongoose to use string ids in the Vulcan Next model https://forums.meteor.com/t/using-mongoose-to-query-a-mongo-db-that-was-from-a-meteor-db/53789 There is an example "user.server" model in Vulcan Next - - - - #### Check the existing password