arunoda / meteor-smart-collections

Meteor Collections Re-Imagined
MIT License
147 stars 13 forks source link

Mongo extensions (aggregation) support #10

Closed zvictor closed 11 years ago

zvictor commented 11 years ago

I am migrating my application to use Smart Collections and I faced the lack of aggregation support which I had already overcome using a snippet based on meteor-mongo-extensions, so I decided to adapt this extension to work with Smart Collection.

My problem is that it was too easy to do I am afraid I am missing something else, so I created this topic to discuss this matter. Please, tell me if my thought is right.

Here my is gist that just binds the smart collections to dummy regular collections.

arunoda commented 11 years ago

I think the the code in the gist is fine. Since we are talking to the same DB, you don't need to go with SmartCollection's mongo adapter.

I also think mapReduce returns the collection name as the result. And You can use SmartCollections to bring back the result to the client/server.

zvictor commented 11 years ago

Excelent! =D

I also think mapReduce returns the collection name as the result. And You can use SmartCollections to bring back the result to the client/server.

The data of the created collection will be propagated across mongo instances?

arunoda commented 11 years ago

Are you using multiple mongos? I'm not sure about it.

If uses a replSet it should be, If sharded hope not.

zvictor commented 11 years ago

Whatever we define mapReduce it has a big issue to overcome: jhoxray/meteor-mongo-extensions#4