View Source Bonfire.Me.Users.Queries (Bonfire v0.9.11-social-beta.6)

Queries for Bonfire.Me.Users

Summary

Functions

Returns the query to list admin users.

Finds users by account ID.

Finds a user by canonical URI.

Gets a user by ID.

Finds a user by username or user ID and account ID.

Finds a user by username or ID.

Finds a user by username.

Counts the number of users.

Returns for the current user based on the user ID.

Returns for the current user based on the user ID and account ID.

Lists all users, or local or remote users, or users by instance ID.

Queries for a user based on the given filter.

Searches for users based on a text string.

Functions

admins(opts \\ [])

Returns the query to list admin users.

base_by_id(id)

base_query()

by_account(account_id)

Finds users by account ID.

Examples

iex> Bonfire.Me.Users.Queries.by_account("account_id")

by_canonical_uri(canonical_uri, opts \\ [])

Finds a user by canonical URI.

Examples

iex> Bonfire.Me.Users.Queries.by_canonical_uri("canonical_uri")

by_id(id, opts \\ [])

Gets a user by ID.

Examples

iex> Bonfire.Me.Users.Queries.by_id("user_id")

by_user_and_account(username_or_user_id, account_id)

Finds a user by username or user ID and account ID.

Examples

iex> Bonfire.Me.Users.Queries.by_user_and_account("username_or_user_id", "account_id")

by_username_or_id(username_or_id, opts \\ [])

Finds a user by username or ID.

Examples

iex> Bonfire.Me.Users.Queries.by_username_or_id("username_or_id")

by_username_query(username, opts \\ [])

Finds a user by username.

Examples

iex> Bonfire.Me.Users.Queries.by_username_query("username")

context_module()

Callback implementation for Bonfire.Common.QueryModule.context_module/0.

count(arg1)

Counts the number of users.

Examples

iex> Bonfire.Me.Users.Queries.count(:all)

iex> Bonfire.Me.Users.Queries.count(:local)

iex> Bonfire.Me.Users.Queries.count(:remote)

current(user_id)

Returns for the current user based on the user ID.

Examples

iex> Bonfire.Me.Users.Queries.current("user_id")

current(user_id, account_id)

Returns for the current user based on the user ID and account ID.

Examples

iex> Bonfire.Me.Users.Queries.current("user_id", "account_id")

join_peered(q)

list(arg1)

Lists all users, or local or remote users, or users by instance ID.

Examples

iex> Bonfire.Me.Users.Queries.list(:all)

iex> Bonfire.Me.Users.Queries.list(:local)

iex> Bonfire.Me.Users.Queries.list(:remote)

iex> Bonfire.Me.Users.Queries.list({:instance, "instance_id"})

query(filters, opts \\ [])

Queries for a user based on the given filter.

Examples

iex> Bonfire.Me.Users.Queries.query(id: "some_id")

iex> Bonfire.Me.Users.Queries.query(username: "some_username")

iex> Bonfire.Me.Users.Queries.query(:invalid_filter)
{:error, "Could not query"}

schema_module()

Callback implementation for Bonfire.Common.QueryModule.schema_module/0.

search(text, opts \\ [])

Searches for users based on a text string.

Examples

iex> Bonfire.Me.Users.Queries.search("userna")