Mongo.update_one

You're seeing just the function update_one, go back to Mongo module for more information.
Link to this function

update_one(topology_pid, coll, filter, update, opts \\ [])

View Source

Specs

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 to true creates a new document when no document matches the filter (default: false)