Mongo.update_one
You're seeing just the function
update_one
, go back to Mongo module for more information.
Specs
update_one( GenServer.server(), collection(), BSON.document(), BSON.document(), Keyword.t() ) :: result(Mongo.UpdateResult.t())
Update a single document matching the filter.
Uses MongoDB update operators to specify the updates. For more information please refer to the MongoDB documentation
Example:
Mongo.update_one(MongoPool,
"my_test_collection",
%{"filter_field": "filter_value"},
%{"$set": %{"modified_field": "new_value"}})
Options
:upsert
- if set totrue
creates a new document when no document matches the filter (default:false
)