Search code examples
node.jsmeteorcollectionsloopbackjsloopback

Loopback with meteor


we have a database connected to meteor and loopback services each one edits in the same collection in database.

I found that meteor have to create the model in a way and this link in loopback https://loopback.io/doc/en/lb2/MongoDB-connector.html includes only connecting to database and create model not to connect already with a collection in database so anyone have an idea how to design and connect the two services with same collection to edit ? or they detect automatically the collections once I connect the datasource?


Solution

  • Yes, this should already work. Meteor uses OPLog tailing to detect changes to the database and it doesn't have any opinion on how the documents in the collection should look like. It will create _ids that are strings rather than ObjectIds, but it can work with either. So as long as the other services doesn't mind the string _ids you should be fine.