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

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

post - imageshack API cURL -