skip to Main Content

why java mongodb driver update a value can't start with $

UpdateOptions options = new UpdateOptions().upsert(true); Bson filters = Filters.eq("id", 123456); List<Bson> bsonArrayList = new ArrayList<>(); bsonArrayList.add(Updates.set("income", "$300k")); UpdateResult updateResult = mongoExe.updateOne(filters, bsonArrayList, options); The field name is income, value is $200k. It can't update until I delete the $ bsonArrayList.add(Updates.set("income",…

VIEW QUESTION

Json – Jolt transform array into multiple Objects

I am trying to transform the below JSON: Input: { "steps": [ { "end": "2023-01-27T09:19:29.849298Z", "id": "1", "start": "2023-01-27T09:18:24.59325Z", "name": "foo" }, { "end": "2023-01-28T09:19:29.849298Z", "id": "2", "start": "2023-01-28T09:18:24.59325Z", "name": "bar" } ] } Output: { "steps": [ { "end":…

VIEW QUESTION
Back To Top
Search