fix(mongodb): use dedicated count for legacy collections
This commit is contained in:
1 parent
03bc87c77a
commit
a99a34b4ab
28 files changed
+916
-19
No files matched your search
@@ -93,6 +93,7 @@ test("parseMongoCountDocumentsCommand accepts shell-style count commands", () =>
|
||||
assert.deepEqual(parseMongoCountDocumentsCommand('db.projects.countDocuments({"active":true})'), {
|
||||
collection: "projects",
|
||||
filter: '{"active":true}',
|
||||
mode: "accurate",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -100,14 +101,17 @@ test("parseMongoCountDocumentsCommand accepts legacy count helpers", () => {
|
||||
assert.deepEqual(parseMongoCountDocumentsCommand("db.projects.count({ active: true })"), {
|
||||
collection: "projects",
|
||||
filter: '{ "active": true }',
|
||||
mode: "legacy",
|
||||
});
|
||||
assert.deepEqual(parseMongoCountDocumentsCommand('db.getCollection("audit.logs").count()'), {
|
||||
collection: "audit.logs",
|
||||
filter: "{}",
|
||||
mode: "legacy",
|
||||
});
|
||||
assert.deepEqual(parseMongoCountDocumentsCommand("db.projects.find({ active: true }).count()"), {
|
||||
collection: "projects",
|
||||
filter: '{ "active": true }',
|
||||
mode: "legacy",
|
||||
});
|
||||
assert.equal(parseMongoFindCommand("db.projects.find({ active: true }).count()"), null);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user