Mongo.Repo.get_by

You're seeing just the callback get_by, go back to Mongo.Repo module for more information.
Link to this callback

get_by(module, query, opts)

View Source (optional)

Specs

get_by(module :: module(), query :: BSON.document(), opts :: Keyword.t()) ::
  Mongo.Collection.t() | nil | {:error, any()}

Returns a single document struct for the collection defined in the given module and query.

Returns nil if no result was found.

If multiple documents satisfy the query, this method returns the first document according to the natural order which reflects the order of documents on the disk.

For all options see Options

Example

MyApp.Repo.get_by(Post, %{title: title})
MyApp.Repo.get_by(Post, %{title: title}, read_concern: %{level: "local"})