File: hint1.js

package info (click to toggle)
mongodb 1%3A1.4.4-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,816 kB
  • ctags: 11,368
  • sloc: cpp: 58,805; ansic: 18,160; python: 1,255; sh: 238; makefile: 82
file content (10 lines) | stat: -rw-r--r-- 455 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10

p = db.jstests_hint1;
p.drop();

p.save( { ts: new Date( 1 ), cls: "entry", verticals: "alleyinsider", live: true } );
p.ensureIndex( { ts: 1 } );

e = p.find( { live: true, ts: { $lt: new Date( 1234119308272 ) }, cls: "entry", verticals: " alleyinsider" } ).sort( { ts: -1 } ).hint( { ts: 1 } ).explain();
assert.eq( e.indexBounds[0][0].ts.getTime(), new Date( 1234119308272 ).getTime() , "A" );
assert.eq( 0 , e.indexBounds[0][1].ts.getTime() , "B" );