Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare index type ObjectId in array doesn't work #232

Open
masatakaIshii opened this issue Aug 9, 2024 · 0 comments
Open

Compare index type ObjectId in array doesn't work #232

masatakaIshii opened this issue Aug 9, 2024 · 0 comments

Comments

@masatakaIshii
Copy link

When I want to update one document and precisely one element in array of subdocument, mongo-java-server doesn't find match.

For example :

myCollection.updateOne(
        and(eq("_id", myId), , eq("myArray._id", new ObjectId(myArrayId))),
        set("myArray.$.name", newName)
);

The result of this update don't find match neither modified count :

AcknowledgedUpdateResult{matchedCount=0, modifiedCount=0, upsertedId=null}

Using the version 1.45.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant