Skip to content

Commit

Permalink
Tweak to argument order for $setField
Browse files Browse the repository at this point in the history
  • Loading branch information
speedytwenty committed Sep 19, 2024
1 parent 17e6e24 commit a3c1893
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3113,7 +3113,7 @@ const $setDifference = at('$setDifference');
const $setEquals = pta('$setEquals');

// TODO
const $setField = (field: string, value: Expression, input: ObjectExpression) => ({
const $setField = (input: ObjectExpression, field: string, value: Expression) => ({
$setField: { field, input, value },
});

Expand Down
2 changes: 1 addition & 1 deletion pipeline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ describe('aggregation', () => {
expect($.setField).toStrictEqual($.$setField);
});
it('returns expected result', () => {
expect($.setField('foo', '$value', '$doc')).toEqual({
expect($.setField('$doc', 'foo', '$value')).toEqual({
$setField: {
field: 'foo',
value: '$value',
Expand Down

0 comments on commit a3c1893

Please sign in to comment.