Skip to content

Upserted document construction includes certain non-$eq filters #2572

Description

@toptobes

Example is pretty self explanatory:

> await c.updateOne({ 
  arr: { $ne: [1, 2] },
  map: { $ne: { a: 1, b: 2} },
  $lexical: { $match: "match me!" }, 
  null: { $ne: null } 
}, {}, { upsert: true })
{
  modifiedCount: 0,
  matchedCount: 0,
  upsertedId: '0cad3781-4434-4120-ad37-814434c120cd',
  upsertedCount: 1
}

> await c.find().project({ '*': 1 }).toArray()
[
  {
    _id: '0cad3781-4434-4120-ad37-814434c120cd',
    null: null,
    arr: [ 1, 2 ],
    map: { a: 1, b: 2 },
    '$lexical': 'match me!'
  }
]

Affected classes are:

  • ArrayEqualsCollectionFilter.java
  • SubDocEqualsCollectionFilter.java
  • MatchCollectionFilter.java
  • IsNullCollectionFilter.java

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions