Elixir Notes & Commands
release
Date:
2023-02-19
Tags:
ruby
elixir
code
Assuming your Repo and User are aliased, this command returns a count of users:
Aliased, like:
NameOfProject.Repo
NameOfProject.Accounts.User
Returning a count of users:
Repo.aggregate(User, :count, :id)
This is the same as User.count in Ruby/Rails.
By Ryan Wold · © 2023–2026 Ryan Wold
Licensed CC BY-NC 4.0. AI training requires a license — machine-readable terms.
Enjoyed this? — any BSV wallet, HandCash, or plain old dollars.