|
14 | 14 |
|
15 | 15 | from collections import namedtuple |
16 | 16 |
|
17 | | -from mockupdb import OpMsg, OpMsgReply, OpReply |
| 17 | +from mockupdb import OpMsgReply, OpReply |
18 | 18 |
|
19 | 19 | from pymongo import ReadPreference |
20 | 20 |
|
|
61 | 61 | not_master=not_master_reply, |
62 | 62 | ), |
63 | 63 | Operation( |
64 | | - "count", |
| 64 | + "count_documents", |
65 | 65 | lambda client: client.db.collection.count_documents({}), |
66 | 66 | reply={"n": 1}, |
67 | 67 | op_type="may-use-secondary", |
68 | 68 | not_master=not_master_reply, |
69 | 69 | ), |
| 70 | + Operation( |
| 71 | + "estimated_document_count", |
| 72 | + lambda client: client.db.collection.estimated_document_count(), |
| 73 | + reply={"n": 1}, |
| 74 | + op_type="may-use-secondary", |
| 75 | + not_master=not_master_reply, |
| 76 | + ), |
70 | 77 | Operation( |
71 | 78 | "aggregate", |
72 | 79 | lambda client: client.db.collection.aggregate([]), |
|
109 | 116 |
|
110 | 117 | Upgrade = namedtuple("Upgrade", ["name", "function", "old", "new", "wire_version"]) |
111 | 118 |
|
112 | | -upgrades = [ |
113 | | - Upgrade( |
114 | | - "estimated_document_count", |
115 | | - lambda client: client.db.collection.estimated_document_count(), |
116 | | - old=OpMsg("count", "collection", namespace="db"), |
117 | | - new=OpMsg("aggregate", "collection", namespace="db"), |
118 | | - wire_version=12, |
119 | | - ), |
120 | | -] |
| 119 | +upgrades = [] |
0 commit comments