Liking cljdoc? Tell your friends :D

firestore-clj.core


->atomclj

(->atom q)
(->atom q
        {:keys [error-handler plain-fn]
         :or {error-handler identity plain-fn snap->plain}})

Returns an atom holding the latest value of a DocumentReference or Query.

Returns an atom holding the latest value of a DocumentReference or Query.
sourceraw docstring

->streamclj

(->stream q)
(->stream q
          {:keys [error-handler plain-fn]
           :or {error-handler identity plain-fn snap->plain}})

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.
sourceraw docstring

add!clj

(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.
sourceraw docstring

add-listenerclj

(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.
sourceraw docstring

array-removeclj

(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.
sourceraw docstring

array-unionclj

(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.
sourceraw docstring

assocclj

(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.
sourceraw docstring

assoc!clj

(assoc! dr & fvs)

Associates new fields and values.

Associates new fields and values.
sourceraw docstring

batchclj

(batch db)

Get a new write batch

Get a new write batch
sourceraw docstring

batch-delete!clj

(batch-delete! doc-seq batch-size)

Deletes all documents in a seq of DocumentReference.

Deletes all documents in a seq of DocumentReference.
sourceraw docstring

changesclj

(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}`.
sourceraw docstring

client-with-credsclj

(client-with-creds creds-path)

Creates a client from a credentials JSON file.

Creates a client from a credentials JSON file.
sourceraw docstring

collclj

(coll r coll-name)

Returns a CollectionReference for the collection of given name.

Returns a CollectionReference for the collection of given name.
sourceraw docstring

coll-groupclj

(coll-group db coll-id)

Returns a query that includes all documents contained in a collection or subcollection with the given id.

Returns a query that includes all documents contained in a collection or subcollection with the given id.
sourceraw docstring

collsclj

(colls d)
(colls d cs)

Returns collections or subcollections as a vector of CollectionReference.

Returns collections or subcollections as a vector of CollectionReference.
sourceraw docstring

commit!clj

(commit! b)

Commits a write batch.

Commits a write batch.
sourceraw docstring

countclj

(count qs)

Number of documents in a QuerySnapshot

Number of documents in a QuerySnapshot
sourceraw docstring

create!clj

(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.
sourceraw docstring

create-timeclj

(create-time ds)

The time at which this document was created.

The time at which this document was created.
sourceraw docstring

default-clientclj

(default-client project-id)

Gets default client i.e. using a service account.

Gets default client i.e. using a service account.
sourceraw docstring

deleteclj

(delete context dr)

Deletes a document in a batched write/transaction context.

Deletes a document in a batched write/transaction context.
sourceraw docstring

delete!clj

(delete! dr)

Deletes a document.

Deletes a document.
sourceraw docstring

delete-all!clj

(delete-all! q)
(delete-all! q 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.
sourceraw docstring

delete-all!*clj

(delete-all!* q)
(delete-all!* q batch-size)

Deletes all documents resulting from a query. Batches for efficiency. Fetches all results in memory.

Deletes all documents resulting from a query. Batches for efficiency. Fetches all results in memory.
sourceraw docstring

detachclj

(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`.
sourceraw docstring

dissocclj

(dissoc context dr & ks)

Deletes keys in a batched write/transaction context.

Deletes keys in a batched write/transaction context.
sourceraw docstring

dissoc!clj

(dissoc! dr & fields)

Deletes fields.

Deletes fields.
sourceraw docstring

docclj

(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
sourceraw docstring

doc-snapclj

(doc-snap dr)
(doc-snap dr t)

Gets a QueryDocumentSnapshot given a DocumentReference and possibly a Transaction.

Gets a QueryDocumentSnapshot given a DocumentReference and possibly a Transaction.
sourceraw docstring

docsclj

(docs c)
(docs c ds)

Gets a vector of DocumentReferences.

Gets a vector of `DocumentReference`s.
sourceraw docstring

ds->plainclj

(ds->plain s)

Represents a DocumentSnapshot as plain map.

Represents a DocumentSnapshot as plain map.
sourceraw docstring

ds->plain-with-idclj

(ds->plain-with-id s)

Represents a DocumentSnapshot as a [id plain-doc] pair

Represents a DocumentSnapshot as a [id plain-doc] pair
sourceraw docstring

emulator-clientclj

(emulator-client project-id emulator-host)

Gets a client using the emulator.

Gets a client using the emulator.
sourceraw docstring

end-atclj

(end-at q & args)

Ends results at the provided document, or at the provided fields relative to the order of the query.

Ends results at the provided document, or at the provided fields relative to the order of the query.
sourceraw docstring

end-beforeclj

(end-before q & args)

Ends results before the provided document, or at the provided fields relative to the order of the query.

Ends results before the provided document, or at the provided fields relative to the order of the query.
sourceraw docstring

exists?clj

(exists? ds)

Checks whether the document snapshot exists.

Checks whether the document snapshot exists.
sourceraw docstring

filter-containsclj

(filter-contains q field value)

Filters where field contains value.

Filters where field contains value.
sourceraw docstring

filter-contains-anyclj

(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.
sourceraw docstring

filter-inclj

(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.
sourceraw docstring

filter<clj

(filter< q field value)

Filters where field < value.

Filters where field < value.
sourceraw docstring

filter<=clj

(filter<= q field value)

Filters where field <= value.

Filters where field <= value.
sourceraw docstring

filter=clj

(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.
sourceraw docstring

filter>clj

(filter> q field value)

Filters where field > value.

Filters where field > value.
sourceraw docstring

filter>=clj

(filter>= q field value)

Filters where field >= value.

Filters where field >= value.
sourceraw docstring

firestoreclj

(firestore q)

Gets the Firestore instance associated with this query.

Gets the Firestore instance associated with this query.
sourceraw docstring

geo-pointclj

(geo-point [lat lon])

Creates a geocode object from a lat lon pair.

Creates a geocode object from a lat lon pair.
sourceraw docstring

idclj

(id d)

Returns the id of a CollectionReference, DocumentReference or DocumentSnapshot.

Returns the id of a CollectionReference, DocumentReference or DocumentSnapshot.
sourceraw docstring

incclj

(inc v)

Used with set! and merge!. Increments a numeric field.

Used with `set!` and `merge!`. Increments a numeric field.
sourceraw docstring

lat-lonclj

(lat-lon g)

Returns a lat lon pair from a GeoPoint.

Returns a lat lon pair from a GeoPoint.
sourceraw docstring

limitclj

(limit q n)

Limits results to a certain number.

Limits results to a certain number.
sourceraw docstring

map!clj

(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
sourceraw docstring

mark-for-deletionclj

(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.
sourceraw docstring

mergeclj

(merge context dr m)
(merge context dr m updated-time)

Updates field of a document in a batched write/transaction context.

Updates field of a document in a batched write/transaction context.
sourceraw docstring

merge!clj

(merge! dr m)
(merge! dr m updated-time)

Updates fields of a document. Accepts an updated-time as precondition.

Updates fields of a document. Accepts an updated-time as precondition.
sourceraw docstring

offsetclj

(offset q n)

Skips the first n results.

Skips the first n results.
sourceraw docstring

order-byclj

(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.
sourceraw docstring

parentclj

(parent dr)

A reference to the collection to which this document belongs to.

A reference to the collection to which this document belongs to.
sourceraw docstring

pathclj

(path r)

A string representing the path of the referenced document or collection.

A string representing the path of the referenced document or collection.
sourceraw docstring

pullclj

(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.
sourceraw docstring

pull-docclj

Pulls clojure data from a DocumentReference.

Pulls clojure data from a DocumentReference.
sourceraw docstring

pull-docsclj

(pull-docs drs)
(pull-docs drs 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.
sourceraw docstring

pull-queryclj

Pulls results from a Query as clojure data.

Pulls results from a Query as clojure data.
sourceraw docstring

pullvclj

Pulls query results as a vector of document data.

Pulls query results as a vector of document data.
sourceraw docstring

pullv-with-idsclj

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
sourceraw docstring

purge!clj

(purge! root)
(purge! root batch-size)

If a document, deletes it and all its subcollections recursively. If a collection or query, purges all its documents. Operates in batches.

If a document, deletes it and all its subcollections recursively. If a collection or query,
purges all its documents. Operates in batches.
sourceraw docstring

qs->plain-mapclj

(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.
sourceraw docstring

qs->plainvclj

(qs->plainv s)

Represents a QuerySnapshot as a plain vector of document data.

Represents a QuerySnapshot as a plain vector of document data.
sourceraw docstring

qs->plainv-with-idsclj

(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.
sourceraw docstring

query-snapclj

(query-snap q)
(query-snap q t)

Gets a QuerySnapshot given a Query and possibly a Transaction.

Gets a QuerySnapshot given a Query and possibly a Transaction.
sourceraw docstring

query-snap->doc-snapsclj

(query-snap->doc-snaps qs)

Gets DocumentSnapshots from a QuerySnapshot

Gets DocumentSnapshots from a QuerySnapshot
sourceraw docstring

rangeclj

(range q start end)

Gets a range

Gets a range
sourceraw docstring

read-timeclj

(read-time q)

The time at which this snapshot was read.

The time at which this snapshot was read.
sourceraw docstring

refclj

(ref ds)

Gets a reference to the document this snapshot refers to.

Gets a reference to the document this snapshot refers to.
sourceraw docstring

selectclj

(select q & fields)

Selects given fields

Selects given fields
sourceraw docstring

server-timestampclj

(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.
sourceraw docstring

setclj

(set context dr m)
(set context dr m kw)
(set context dr m kw args)

Creates or overwrites a document in a batched write/transaction context.

Creates or overwrites a document in a batched write/transaction context.
sourceraw docstring

set!clj

(set! dr m)
(set! dr m kw)
(set! dr m kw args)

Creates or overwrites a document.

Creates or overwrites a document.
sourceraw docstring

snapclj

(snap q)
(snap q t)

Gets a DocumentSnapshot or QuerySnapshot given a DocumentReference or Query.

Gets a DocumentSnapshot or QuerySnapshot given a DocumentReference or Query.
sourceraw docstring

snap->plainclj

(snap->plain s)

Gets a DocumentSnapshot/CollectionSnapshot/QuerySnapshot's underlying data.

Gets a DocumentSnapshot/CollectionSnapshot/QuerySnapshot's underlying data.
sourceraw docstring

start-afterclj

(start-after q & args)

Starts results after the provided document, or at the provided fields relative to the order of the query.

Starts results after the provided document, or at the provided fields relative to the order of the query.
sourceraw docstring

start-atclj

(start-at q & args)

Starts results at the provided document, or at the provided fields relative to the order of the query.

Starts results at the provided document, or at the provided fields relative to the order of the query.
sourceraw docstring

subdocsclj

(subdocs dr)

A lazy sequence including given document and all documents in its subcollections.

A lazy sequence including given document and all documents in its subcollections.
sourceraw docstring

transact!clj

(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.
sourceraw docstring

update!clj

(update! dr f & args)

Updates a document by applying a function to it.

Updates a document by applying a function to it.
sourceraw docstring

update-field!clj

(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.
sourceraw docstring

update-timeclj

(update-time ds)

The time at which this document was last updated.

The time at which this document was last updated.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close