Hi,
I have a “simple” problem, what I can’t solute myself.
I wrote a small java class which uses the reactive mongodb lib: mongodb-driver-reactivestreams
Here is the class: https://pastebin.com/Ddfz6pq7
The idea is to create a object and call connect to connect this object with a mongodb database and to choose a collection.
Now my problem. The updateOne method doesn’t have any effect.
Here the entry of the players connection which should be updated:
_id: 5f3271160ef36644c04d61fb
requested: null
role: "STAFF"
discordID: null
balance: 316.3
town: "Tutorial"
lastDonation: "0"
referredBy: "x"
name: "Tockra"
uuid: "abcd"
So I call updateOne with a uuid filter (abcd) and a new entry which should update all stuff:
[12:51:57 INFO]: FILTERDOC: {"uuid": "abcd"}
[12:51:57 INFO]: PLAYER: {"requested": null, "role": "STAFF", "discordID": null, "balance": 317.3, "town": "Tutorial", "referredBy": "x", "lastDonation": "0", "name": "Tockra", "uuid": "abcd"}
After looking into the database with mongodb compass the balance (which is the only changed value), isn’t changed…
What did I wrong?
T
€dit: If I replace updateOne with replaceOne it works. But why?