Skip to content

Commit 3a3cf0e

Browse files
authored
JS Server : Fix documentIDs filter lookup by collection name (#305)
* Python tests always specify the documentIDs filter with the full collection name. * With the current CBL-JS implemention, the collection’s name property may not include the '<scope>.' prefix for the default scope. We could enhance this to always return the full-collection name for consistency as the Collection class in JS doesn’t have the scope property either. This is not a blocker for 1.0.0 release.
1 parent 4855850 commit 3a3cf0e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

servers/javascript/src/filters.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ export const TDKReplicationFilters: Record<string,FilterMaker> = {
1515
check(isObject(documentIDs), "documentIDs must be an object");
1616

1717
const meta = cbl.meta(doc);
18-
const ids = documentIDs[meta.collection.name];
18+
const collectionFullName = meta.collection.name.includes(".")
19+
? meta.collection.name
20+
: `_default.${meta.collection.name}`;
21+
22+
const ids = documentIDs[collectionFullName];
1923
check(Array.isArray(ids), "documentIDs's value must be an array");
2024

2125
const docSet = new Set(ids);

0 commit comments

Comments
 (0)