Site Logo
Looking for girlfriend > Dating for life > Find multiple collections mongodb

Find multiple collections mongodb

I first need to query the FollowersCollection passing in the uid of the user that we want to display followers for. This would search the FollowersCollection matching the supplied uid to any record with a matching uid and return an array of all of the user ids fid that follow them. So I really need the second component to return an array with the complete results of each follower with their data. In SQL this is a simple process but with a non-relational database like Mongo this seems to be really difficult to achieve. I tried to use distinct in the following Method on the server just to try and get some results :. Exception while invoking method 'get.

SEE VIDEO BY TOPIC: How To Joining Two Collection in MongoDB

Content:
SEE VIDEO BY TOPIC: MongoDB A to Z - Video 15 Querying Across Multiple Collections & Tables

Aggregating Multiple Collections In MongoDB

I first need to query the FollowersCollection passing in the uid of the user that we want to display followers for. This would search the FollowersCollection matching the supplied uid to any record with a matching uid and return an array of all of the user ids fid that follow them. So I really need the second component to return an array with the complete results of each follower with their data. In SQL this is a simple process but with a non-relational database like Mongo this seems to be really difficult to achieve.

I tried to use distinct in the following Method on the server just to try and get some results :. Exception while invoking method 'get. Making some progress so will keep updating this thread until I work it out incase there are others having a similar issue….

Managed to get distinct working by accessing the raw collection. This returns all of the ids of a users followers :. Okay more progress, I am now getting my full array back server side at least. Which is console logging the array to the client perfectly.

Now I just need to store the data and use it. Okay I give up. WHY is it this hard? This has driven me to the point of despair. I have it working perfectly in other components where an entire collection is being queried.

How to create a Mongo query with multiple collections? But this is unusable with Infinite Scroll which I need. This answer from SO looks like it should do what I need… db. EDIT 2 Making some progress so will keep updating this thread until I work it out incase there are others having a similar issue… Managed to get distinct working by accessing the raw collection.

This returns all of the ids of a users followers : 'get. Is there anybody out there using React with Meteor that can put me out of my misery please?

Mongo Aggregations in 5 Minutes

Specifies the collection in the same database to perform the join with. The from collection cannot be sharded. For details, see Sharded Collection Restrictions.

At Universe, we use Mongo as a primary data store for our events, users, sessions, and more. The documents we store in our collections tend to be mostly uniform attribute-wise.

By using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Here is a sample from my mongodb. I want to get all the posts which has "via" attribute equal to "facebook" and posted by an admin "admin" I couldn't figure out how to acquire this query.

Subscribe to RSS

By using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I know the theory of MongoDB and the fact that is doesn't support joins, and that I should use embeded documents or denormalize as much as possible, but here goes:. I know that I have to do multiple queries to get it done, but how can that be achieved? With mapReduce or aggregate? This answer is outdated. Since version 3. MongoDB does not do queries which span multiple collections - period.

.

.

.

.

.

.

I wish to fetch data from two collections using a single query. frontporchbliss.com Join ResearchGate to find the people and research you need to help your work.9 answers.

.

.

.

.

.

.

.

Comments: 0
  1. No comments yet.

Thanks! Your comment will appear after verification.
Add a comment

© 2020 Online - Advisor on specific issues.