(->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.
(->stream q)
(->stream q
{:keys [error-handler plain-fn]
:or {error-handler identity plain-fn snapshot->data}})
Returns a manifold stream pushing the latest values of a DocumentReference or Query.
Returns a manifold stream pushing the latest values of a DocumentReference or Query.
(add! cr 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 dr & fvs)
Associates new fields and values in a batched write/transaction context.
Associates new fields and values in a batched write/transaction context.
(assoc! dr & fvs)
Associates new fields and values.
Associates new fields and values.
(changes s)
Returns a vector of changes. Each change is a map with keys :type
, :ref
, :new-index
,
and :old-index
. Type is one of #{:added :removed :modified}
.
Returns a vector of changes. Each change is a map with keys `:type`, `:ref`, `:new-index`, and `:old-index`. Type is one of `#{:added :removed :modified}`.
(client-with-creds creds-path)
Creates a client from a credentials JSON file.
Creates a client from a credentials JSON file.
(coll r coll-name)
Returns a CollectionReference for the collection of given name.
Returns a CollectionReference for the collection of given name.
(colls d)
(colls d cs)
Returns collections or subcollections as a vector of CollectionReference.
Returns collections or subcollections as a vector of CollectionReference.
(count qs)
Number of documents in a QuerySnapshot
Number of documents in a QuerySnapshot
(create! dr 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.
(create-time ds)
The time at which this document was created.
The time at which this document was created.
(default-client project-id)
Gets default client i.e. using a service account.
Gets default client i.e. using a service account.
(delete context dr)
Deletes a document in a batched write/transaction context.
Deletes a document in a batched write/transaction context.
(delete-all! cr)
(delete-all! cr batch-size)
Deletes all documents from a query. Batches for efficiency. Query must not contain limit or offset.
Deletes all documents from a query. Batches for efficiency. Query must not contain limit or offset.
(delete-all!* cr)
(delete-all!* cr batch-size)
Deletes all documents from a query. Batches for efficiency. Fetches all results in memory.
Deletes all documents from a query. Batches for efficiency. Fetches all results in memory.
(detach a)
Detaches an atom built with ->atom
or a listener returned from add-listener
.
Detaches an atom built with `->atom` or a listener returned from `add-listener`.
(dissoc context dr & ks)
Deletes keys in a batched write/transaction context.
Deletes keys in a batched write/transaction context.
(doc cr)
(doc cr id)
Gets a DocumentReference given CollectionReference or Firestore and a path. If path is not given, it will point to a new document with an auto-generated-id
Gets a DocumentReference given CollectionReference or Firestore and a path. If path is not given, it will point to a new document with an auto-generated-id
(doc-snaps qs)
Gets DocumentSnapshots from a QuerySnapshot
Gets DocumentSnapshots from a QuerySnapshot
(doc-snapshot dr)
(doc-snapshot dr t)
Gets a QueryDocumentSnapshot given a DocumentReference and possibly a Transaction.
Gets a QueryDocumentSnapshot given a DocumentReference and possibly a Transaction.
(docs c)
(docs c ds)
Gets a vector of DocumentReference
s.
Gets a vector of `DocumentReference`s.
(ds->plain s)
Represents a DocumentSnapshot as plain map.
Represents a DocumentSnapshot as plain map.
(ds->plain-with-id s)
Represents a DocumentSnapshot as a [id plain-doc] pair
Represents a DocumentSnapshot as a [id plain-doc] pair
(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.
(firestore q)
Gets the Firestore instance associated with this query.
Gets the Firestore instance associated with this query.
(id d)
Returns the id of a CollectionReference, DocumentReference or DocumentSnapshot.
Returns the id of a CollectionReference, DocumentReference or DocumentSnapshot.
(inc v)
Used with set!
and merge!
. Increments a numeric field.
Used with `set!` and `merge!`. Increments a numeric field.
(limit q n)
Limits results to a certain number.
Limits results to a certain number.
(map! 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 dr m)
Updates field of a document in a batched write/transaction context.
Updates field of a document in a batched write/transaction context.
(merge! dr 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.
(parent dr)
A reference to the collection to which this document belongs to.
A reference to the collection to which this document belongs to.
(path r)
A string representing the path of the referenced document or collection.
A string representing the path of the referenced document or collection.
(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 drs)
(pull-docs drs t)
Pulls clojure data from a sequence of DocumentReference
s, 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
(qs->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.
(qs->plainv s)
Represents a QuerySnapshot as a plain vector of document data.
Represents a QuerySnapshot as a plain vector of document data.
(qs->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.
(read-time q)
The time at which this snapshot was read.
The time at which this snapshot was read.
(ref ds)
Gets a reference to the document this snapshot refers to.
Gets a reference to the document this snapshot refers to.
(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 dr m)
Creates or overwrites a document in a batched write/transaction context.
Creates or overwrites a document in a batched write/transaction context.
(set! dr 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.
(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! dr f & args)
Updates a document by applying a function to it.
Updates a document by applying a function to it.
(update-field! dr 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.
(update-time ds)
The time at which this document was last updated.
The time at which this document was last updated.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close