Skip to content

Commit

Permalink
feat: mark CSFLE helper collections as system collections COMPASS-5624 (
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax authored Apr 19, 2022
1 parent 6f08274 commit 62affb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function NS(ns) {
this.collection = ns.slice(this.dotIndex + 1);
}

this.system = /^system\./.test(this.collection);
this.system = /^(?:system|enxcol_)\./.test(this.collection);
this.oplog = /local\.oplog\.(\$main|rs)/.test(ns);

this.command =
Expand Down
3 changes: 3 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ describe('ns', function() {
it('should acccept `a.system.foo`', function() {
assert(ns('a.system.foo').special);
});
it('should acccept `a.enxcol_.foo`', function() {
assert(ns('a.enxcol_.foo').special);
});
it('should not accept `a.foo`', function() {
assert.equal(ns('a.foo').special, false);
});
Expand Down

0 comments on commit 62affb7

Please sign in to comment.