Skip to content

Commit

Permalink
feat: Add ability to specify a cursor's read preference using readFrom()
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Nov 17, 2015
1 parent ea3eb8f commit 0a8ee18
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dist/lib/Cursor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions test/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,12 @@ describe("Model",() => {
return chai.expect(model.find({}, { answer: 0 }).map(i => i.answer)).to.eventually.eql([undefined, undefined, undefined, undefined, undefined]);
});
});

describe("readFrom()", () => {
it("should return a new cursor", () => {
chai.expect(model.find().readFrom('secondaryPreferred')).to.be.instanceof(Cursor);
});
});
});

describe("count()",() => {
Expand Down

0 comments on commit 0a8ee18

Please sign in to comment.