Repository: mdowds/python-mock-firestore

Issue:
Query._apply_cursor is not working for similar objects
Following test will fail:
```
    def test_collection_start_after_similar_objects(self):
        fs = MockFirestore()
        fs._data = {'foo': {
            'first': {'id': 1, 'value': 1},
            'second': {'id': 2, 'value': 2},
            'third': {'id': 3, 'value': 2},
            'fourth': {'id': 4, 'value': 3}
        }}
        docs = list(fs.collection('foo').order_by('id').start_after({'id': 3, 'value': 2}).stream())
        self.assertEqual({'id': 4, 'value': 3}, docs[0].to_dict())
        self.assertEqual(1, len(docs))
```

Only last key in `document_fields` decides if index is set or not because of missing `brake` in search-compare loop inside `Query._apply_cursor`:

```
        for idx, doc in enumerate(doc_snapshot):
            index = None
            for k, v in document_fields.items():
                if doc.to_dict().get(k, None) == v:
                    index = idx
                else:
                    index = None
                    # missing break
            if index:
                ...
    
``` 



Discussion:

Patch:
diff --git a/mockfirestore/query.py b/mockfirestore/query.py
index 354df4b..2e94f07 100644
--- a/mockfirestore/query.py
+++ b/mockfirestore/query.py
@@ -103,6 +103,7 @@ class Query:
                     index = idx
                 else:
                     index = None
+                    break
             if index is not None:
                 if before and start:
                     return islice(docs, index, None, None)


Test patch:
diff --git a/tests/test_collection_reference.py b/tests/test_collection_reference.py
index 5507811..361e3e0 100644
--- a/tests/test_collection_reference.py
+++ b/tests/test_collection_reference.py
@@ -255,6 +255,18 @@ class TestCollectionReference(TestCase):
         self.assertEqual({'id': 2}, docs[0].to_dict())
         self.assertEqual(2, len(docs))
 
+    def test_collection_start_after_similar_objects(self):
+        fs = MockFirestore()
+        fs._data = {'foo': {
+            'first': {'id': 1, 'value': 1},
+            'second': {'id': 2, 'value': 2},
+            'third': {'id': 3, 'value': 2},
+            'fourth': {'id': 4, 'value': 3}
+        }}
+        docs = list(fs.collection('foo').order_by('id').start_after({'id': 3, 'value': 2}).stream())
+        self.assertEqual({'id': 4, 'value': 3}, docs[0].to_dict())
+        self.assertEqual(1, len(docs))
+
     def test_collection_start_after_order_by(self):
         fs = MockFirestore()
         fs._data = {'foo': {