Пример #1
0
    def test_multishard_find_one(self):
        r = operations.multishard_find_one('dummy', {'x': 1})
        self.assertEquals(None, r)

        doc1 = {'x': 1, 'y': 1}
        doc2 = {'x': 2, 'y': 1}
        self.db1.dummy.insert(doc1)
        self.db2.dummy.insert(doc2)

        r = operations.multishard_find_one('dummy', {'x': 1})
        self.assertEquals(r, doc1)

        r = operations.multishard_find_one('dummy', {'x': 2})
        self.assertEquals(r, doc2)
Пример #2
0
    def test_multishard_find_one(self):
        r = operations.multishard_find_one('dummy', {'x': 1})
        self.assertEquals(None, r)

        doc1 = {'x': 1, 'y': 1}
        doc2 = {'x': 2, 'y': 1}
        self.db1.dummy.insert(doc1)
        self.db2.dummy.insert(doc2)

        r = operations.multishard_find_one('dummy', {'x': 1})
        self.assertEquals(r, doc1)

        r = operations.multishard_find_one('dummy', {'x': 2})
        self.assertEquals(r, doc2)
Пример #3
0
 def find_one(self, *args, **kwargs):
     return operations.multishard_find_one(self.collection_name,
                                           with_options=self._with_options,
                                           *args,
                                           **kwargs)
Пример #4
0
 def find_one(self, *args, **kwargs):
     return operations.multishard_find_one(
         self.collection_name,
         with_options=self._with_options, *args, **kwargs)