Reputation: 1469
I have a rails api that creates an embedded document into another document in my meteor application using mongoid. How can I query the embedded documents with meteor?
Upvotes: 1
Views: 712
Reputation: 8928
Once you've written to the mongo database from your rails world via mongoid, assuming you've correctly pointed your Meteor app at this mongo database, simply set up a publication and subscription like any other meteor collection. Then use Minimongo to query the documents. Because it sounds like this is a subdocument, note that per the docs, dot-notation is still a bit sketchy for querying sub documents.
Here is an explanation of Minimongo from the docs:
On the client, a Minimongo instance is created. Minimongo is essentially an in-memory, non-persistent implementation of Mongo in pure JavaScript. It serves as a local cache that stores just the subset of the database that this client is working with. Queries on the client (find) are served directly out of this cache, without talking to the server.
Upvotes: 1