MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_hint_by_name

Method test_hint_by_name

test/test_cursor.py:440–450  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

438 self.assertEqual(0, first.get("num"))
439
440 def test_hint_by_name(self):
441 db = self.db
442 db.test.drop()
443
444 db.test.insert_many([{"i": i} for i in range(100)])
445
446 db.test.create_index([("i", DESCENDING)], name="fooindex")
447 first = next(db.test.find())
448 self.assertEqual(0, first.get("i"))
449 first = next(db.test.find().hint("fooindex"))
450 self.assertEqual(99, first.get("i"))
451
452 def test_limit(self):
453 db = self.db

Callers

nothing calls this directly

Calls 7

nextFunction · 0.90
dropMethod · 0.45
insert_manyMethod · 0.45
create_indexMethod · 0.45
findMethod · 0.45
getMethod · 0.45
hintMethod · 0.45

Tested by

no test coverage detected