Mongodb. Aggregation. $match: [another collection keys] -


User and purchase are two collections The reference key in the purchase store is 'user'. I need to get the entry from the shopping store Which relates to some of the users raised by the city's tag.

  results = db.users.aggregate ({{$ $ $ $ $ $ $ $ $ {{'$ match': {'user_info.city1': 0}}] Db.userset.insert (Results ['Result']) db.purchase.aggregate ([{'$ match': {'user': usersarray (?)}}])  

Can I get more than $ millions of dollars if I have more than a million, and every user can buy more than 10000? Is there another way to do this with aggregation? This example is indexed and about embedded documents Not in.

Yes, the entire query is 16A MBN's BSON document is within the limit. Your second query is most likely to be:

  db.purchase.aggregate ([{'$ match': {'user': {'$ In ': [' user1 ', ...' userN ']}}}])  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -