(->atom q)(->atom q
{:keys [error-handler plain-fn]
:or {error-handler identity plain-fn snapshot->data}})Returns an atom holding the latest value of a DocumentReference or Query.
Returns an atom holding the latest value of a DocumentReference or Query.
(add! c m)Adds a document to a collection. Its id will be automatically generated.
Adds a document to a collection. Its id will be automatically generated.
(add-listener q f)Adds a snapshot listener to a DocumentReference or Query.
Listener is a fn of arity 2. First arg is the QuerySnapshot, second arg is a FirestoreException. Returns an ListenerRegistration object.
Adds a snapshot listener to a DocumentReference or Query. Listener is a fn of arity 2. First arg is the QuerySnapshot, second arg is a FirestoreException. Returns an ListenerRegistration object.
(array-remove & vs)Used with set! and merge!. Removes values from an array field.
Used with `set!` and `merge!`. Removes values from an array field.
(array-union & vs)Used with set! and merge!. Adds unique values to an array field.
Used with `set!` and `merge!`. Adds unique values to an array field.
(assoc context d & kvs)Associates new keys and values in a batched write/transaction context.
Associates new keys and values in a batched write/transaction context.
(assoc! d & kvs)Associates new keys and values.
Associates new keys and values.
(client-with-creds creds-path)Creates a client from a credentials JSON file.
Creates a client from a credentials JSON file.
(coll db coll-name)Returns a CollectionReference for the collection of given name.
Returns a CollectionReference for the collection of given name.
(create! d m)Creates a new document at the DocumentReference's location. Fails if the document exists.
Creates a new document at the DocumentReference's location. Fails if the document exists.
(default-client project-id)Gets default client i.e. using a service account.
Gets default client i.e. using a service account.
(delete context d)Deletes a document in a batched write/transaction context.
Deletes a document in a batched write/transaction context.
(detach a)Detaches an atom built with ->atom.
Detaches an atom built with ->atom.
(dissoc context d & ks)Deletes keys in a batched write/transaction context.
Deletes keys in a batched write/transaction context.
(doc c)(doc c id)Gets a DocumentReference given CollectionReference and an id. If id is not given, it will point to a new document with an auto-generated-id
Gets a DocumentReference given CollectionReference and an id. If id is not given, it will point to a new document with an auto-generated-id
(doc->plain s)Represents a DocumentSnapshot as plain map.
Represents a DocumentSnapshot as plain map.
(doc->plain-with-id s)Represents a DocumentSnapshot as a [id plain-doc] pair
Represents a DocumentSnapshot as a [id plain-doc] pair
(doc-snapshot d)(doc-snapshot d t)Gets a QueryDocumentSnapshot given a DocumentReference and possibly a Transaction.
Gets a QueryDocumentSnapshot given a DocumentReference and possibly a Transaction.
(docs c ds)Gets a vector of DocumentReferences, given a vector of ids
Gets a vector of `DocumentReference`s, given a vector of ids
(filter-contains q field value)Filters where field contains value.
Filters where field contains value.
(filter-contains-any q field arr)Filters where field contains one of the values in arr.
Filters where field contains one of the values in arr.
(filter-in q field arr)Filters where field is one of the values in arr.
Filters where field is one of the values in arr.
(filter< q field value)Filters where field < value.
Filters where field < value.
(filter<= q field value)Filters where field <= value.
Filters where field <= value.
(filter= q m)(filter= q field value)Filters where field = value. A map may be used for checking multiple equalities.
Filters where field = value. A map may be used for checking multiple equalities.
(filter> q field value)Filters where field > value.
Filters where field > value.
(filter>= q field value)Filters where field >= value.
Filters where field >= value.
(id d)Returns the id of a DocumentReference or DocumentSnapshot.
Returns the id of a DocumentReference or DocumentSnapshot.
(inc v)Used with set! and merge!. Increments a numeric field.
Used with `set!` and `merge!`. Increments a numeric field.
(map! db q f & args)Updates all docs in a vector or query by applying a function to them
Updates all docs in a vector or query by applying a function to them
(mark-for-deletion)Used with set! and merge!. A sentinel value that marks a field for deletion.
Used with `set!` and `merge!`. A sentinel value that marks a field for deletion.
(merge context d m)Updates field of a document in a batched write/transaction context.
Updates field of a document in a batched write/transaction context.
(merge! d m)Updates fields of a document.
Updates fields of a document.
(order-by q & ordering)Orders by a sequence of fields with optional directions. Notice that ordering by multiple fields requires creation of a composite index.
Orders by a sequence of fields with optional directions. Notice that ordering by multiple fields requires creation of a composite index.
(pull q)(pull q t)Pulls data from a DocumentReference or Query, possibly inside a transaction context.
Pulls data from a DocumentReference or Query, possibly inside a transaction context.
Pulls clojure data from a DocumentReference.
Pulls clojure data from a DocumentReference.
(pull-docs ds)(pull-docs ds t)Pulls clojure data from a sequence of DocumentReferences, possibly inside a transaction context.
Pulls clojure data from a sequence of `DocumentReference`s, possibly inside a transaction context.
Pulls results from a Query as clojure data.
Pulls results from a Query as clojure data.
Pulls query results as a vector of document data.
Pulls query results as a vector of document data.
Pulls query results as a vector of pairs. Each pair has an id and document data
Pulls query results as a vector of pairs. Each pair has an id and document data
(query->plain-map s)Represents a QuerySnapshot as a plain map whose keys are the document ids.
Represents a QuerySnapshot as a plain map whose keys are the document ids.
(query->plainv s)Represents a QuerySnapshot as a plain vector of document data.
Represents a QuerySnapshot as a plain vector of document data.
(query->plainv-with-ids s)Represents a QuerySnapshot as a plain vector of [id doc] pairs.
Represents a QuerySnapshot as a plain vector of [id doc] pairs.
(query-snapshot q)(query-snapshot q t)Gets a QuerySnapshot given a Query and possibly a Transaction.
Gets a QuerySnapshot given a Query and possibly a Transaction.
(server-timestamp)Used with set! and merge!. Timestamp for when the update operation is performed on server.
Used with `set!` and `merge!`. Timestamp for when the update operation is performed on server.
(set context d m)Creates or overwrites a document in a batched write/transaction context.
Creates or overwrites a document in a batched write/transaction context.
(set! d m)Creates or overwrites a document.
Creates or overwrites a document.
(snapshot->data s)Gets a DocumentSnapshot/CollectionSnapshot/QuerySnapshot's underlying data.
Gets a DocumentSnapshot/CollectionSnapshot/QuerySnapshot's underlying data.
(take q n)Limits results to a certain number.
Limits results to a certain number.
(transact! db f)(transact! db f {:keys [attempts executor] :as options})Performs a transaction. Optionally, you can specify an executor and the maximum number of attemps.
Performs a transaction. Optionally, you can specify an executor and the maximum number of attemps.
(update! db d f & args)Updates a document by applying a function to it.
Updates a document by applying a function to it.
(update-field! db d field f & args)Updates a single field of a document by applying a function to it.
Updates a single field of a document by applying a function to it.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |