MongoDB: How to find the relationship of collections

53 views
Skip to first unread message

Nimatullah Razmjo

unread,
Jun 20, 2018, 5:25:30 AM6/20/18
to mongodb-user

I have a collection of whichuser hasid, firstName, lastName the idfield of the collectionuser has been used in another collection.

Is there any way to find all collection which used user id

Leszek R

unread,
Jun 20, 2018, 9:41:19 AM6/20/18
to mongodb-user
I think you are thinking of mongo collections like a rdbms tables which they are not. Collections do not have schemas defined in them, so they don't keep list of fields used.
Also the list of fields can change from document to document.

To answer your question: There is no way to find all collections that have field "user id" without scanning all documents in all collections.

Nimatullah Razmjo

unread,
Jun 21, 2018, 7:08:28 AM6/21/18
to mongodb-user
Thank you

mayukhasof...@gmail.com

unread,
Jun 24, 2018, 6:05:38 PM6/24/18
to mongodb-user
Schema is dynamically used , we cannot find user id in  all the collections . We can check individually in one collection at a time.
Pleas let me know if you need issues
Regards,
MayukhaITServices

Nimatullah Razmjo

unread,
Jun 25, 2018, 12:11:34 AM6/25/18
to mongod...@googlegroups.com
Thanks,



Best Regards,
Nimatullah

___________

Nimatullah Razmjo

Software Developer / Software Engineer

 

Mobile:  +93 744 78 99 11

Social Network Profiles: FACEBOOK | TWITTER | GOOGLE | LINKEDIN


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/pE5ifj7y0vI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/552a4712-e35e-4285-a029-7cdea80f8275%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages