New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexes for nested array objects are not working #37

Open
adamansky opened this Issue Jan 13, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@adamansky
Member

adamansky commented Jan 13, 2013

Sample:

ejdb> db.open('db')
{ file: '/home/adam/tmp/db', collections: [] }

ejdb> db.save('my', {f:'b', a:[{l:1, m:'o'},{l:2, m:'p'}]});
[ { f: 'b',
    a: 
     [ { l: 1, m: 'o' },
       { l: 2, m: 'p' } ],
    _id: '50f2fe223c78907700000000' } ]

ejdb> db.find('my', {'a.l' : 1});
Found 1 records
{ _id: '50f2fe223c78907700000000',
  f: 'b',
  a: 
   [ { l: 1, m: 'o' },
     { l: 2, m: 'p' } ] }


ejdb> db.find('my', {'a.m' : 'o'});
Found 1 records
{ _id: '50f2fe223c78907700000000',
  f: 'b',
  a: 
   [ { l: 1, m: 'o' },
     { l: 2, m: 'p' } ] }

ejdb> db.ensureNumberIndex('my', 'a.l');

//WRONG RESULT
ejdb> db.find('my', {'a.l' : 2});
Found 0 records

@ghost ghost assigned adamansky Jan 13, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment