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

Method test_hint_by_name

test/asynchronous/test_cursor.py:448–458  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

446 self.assertEqual(0, first.get("num"))
447
448 async def test_hint_by_name(self):
449 db = self.db
450 await db.test.drop()
451
452 await db.test.insert_many([{"i": i} for i in range(100)])
453
454 await db.test.create_index([("i", DESCENDING)], name="fooindex")
455 first = await anext(db.test.find())
456 self.assertEqual(0, first.get("i"))
457 first = await anext(db.test.find().hint("fooindex"))
458 self.assertEqual(99, first.get("i"))
459
460 async def test_limit(self):
461 db = self.db

Callers

nothing calls this directly

Calls 7

anextFunction · 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