mongodb - Checking data integrity with counts -


i have field dictionary in it, mapping people numbers 0-9.

{peopledict : {bob: 3, les: 3, meg: 8, sara: 6}}

i have field dictionary in it, supposed count number of people assigned each number.

{countdict : {"3" : 2, "8" : 1, "6" : 1}}

so document looks like

{peopledict : {bob: 3, les: 3, meg: 8, sara: 6},   countdict : {"3" : 2, "8" : 1, "6" : 1}} 

i trying write query tests whether countdict matches peopledict each document. i'm sure there must way aggregate i'm not quite sure how.

as far know, can't join data different collections. if have them in separate collections need analyze data on application level, or redesign data structure put of them single collection.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -