Liking cljdoc? Tell your friends :D

clarango.collection


createclj

(create collection-name & args)

Creates a new collection.

Takes the name of the new collection as first argument.

Takes optionally a database name and a map containing options as further arguments. These arguments may be passed in arbituary order. If the database name is omitted by the user, the default db will be used.

Possible options in the options map are: {'waitForSync' true/false, 'doCompact' true/false, 'journalSize' journal_size, 'isSystem' true/false, 'isVolatile' true/false, 'type' 2/3, 'keyOptions' [...see below...]} (replace the single quotes with double quotes)

  • waitForSync meaning if the server response should wait until the document is saved to disk
  • doCompact meaning whether of not the collection will be compacted (default is true)
  • journalSize is the maximum size of a journal or datafile; must at least be 1 MB; this can limit also the maximum size of a single object
  • isSystem meaning if a system collection should be created (default is false)
  • isVolatile meaning if the collection should only be kept in-memory and not made persistent --> keeping the collection in-memory only will make it slightly faster, but restarting the server will cause full loss
  • type is the type of the collection: 2 = document collection (default), 3 = edges collection
  • keyOptions: a JSON array containing the following options for key generation:
    • type is the type of the key generator (currently available are 'traditional' and 'autoincrement')
    • allowUserKeys true/false means if true the user can supply his own keys on creating a document; when set to false only the key generator will be responsible for creating the keys;
    • increment is the increment value for the autoincrement key generator (optional)
    • offset is the initial offset value for the autoincrement key generator (optional)
Creates a new collection.

Takes the name of the new collection as first argument.

Takes optionally a database name and a map containing options as further arguments. 
These arguments may be passed in arbituary order.
If the database name is omitted by the user, the default db will be used.

Possible options in the options map are:
{'waitForSync' true/false, 'doCompact' true/false, 'journalSize' journal_size, 'isSystem' true/false, 
'isVolatile' true/false, 'type' 2/3, 'keyOptions' [...see below...]} (replace the single quotes with double quotes)
- waitForSync meaning if the server response should wait until the document is saved to disk
- doCompact meaning whether of not the collection will be compacted (default is true)
- journalSize is the maximum size of a journal or datafile; must at least be 1 MB; this can limit also the maximum size of a single object
- isSystem meaning if a system collection should be created (default is false)
- isVolatile meaning if the collection should only be kept in-memory and not made persistent
  --> keeping the collection in-memory only will make it slightly faster, but restarting the server will cause full loss
- type is the type of the collection: 2 = document collection (default), 3 = edges collection
- keyOptions: a JSON array containing the following options for key generation:
    - type is the type of the key generator (currently available are 'traditional' and 'autoincrement')
    - allowUserKeys true/false means if true the user can supply his own keys on creating a document; 
        when set to false only the key generator will be responsible for creating the keys;
    - increment is the increment value for the autoincrement key generator (optional)
    - offset is the initial offset value for the autoincrement key generator (optional)
sourceraw docstring

deleteclj

(delete collection-name & args)

Deletes a collection.

Takes the name of the collection to be deleted as first argument. Optionally you can pass a database name as second argument.

Deletes a collection.

Takes the name of the collection to be deleted as first argument.
Optionally you can pass a database name as second argument.
sourceraw docstring

get-all-documentsclj

(get-all-documents & args)

Returns a vector with the URIs (or keys or ids) of all documents in the collection.

Can be called without arguments. In that case the default collection from the default database will be used. Optionally you can pass a collection name as first and a database name as second argument. You can also include a map as a last argument containing the 'type' parameter that specifies whether vector of URIs, keys or ids should be returned.

E.g. this method call: (get-all-documents "collection-name" {:type "id"}) will return list of document ids.

Returns a vector with the URIs (or keys or ids) of all documents in the collection.

Can be called without arguments. In that case the default collection from the default database will be used.
Optionally you can pass a collection name as first and a database name as second argument. 
You can also include a map as a last argument containing the 'type' parameter that specifies whether vector of URIs, 
keys or ids should be returned.

E.g. this method call:
    (get-all-documents "collection-name" {:type "id"}) 
will return list of document ids.
sourceraw docstring

get-all-indexesclj

(get-all-indexes & args)

Returns a list with the URIs of all indexes for the collection.

Can be called without arguments. In that case the default collection from the default database will be used. Optionally you can pass a collection name as the first argument and a database name as the second argument.

Returns a list with the URIs of all indexes for the collection.

Can be called without arguments. In that case the default collection from the default database will be used.
Optionally you can pass a collection name as the first argument and a database name as the second argument.
sourceraw docstring

get-delayed-collectionclj

(get-delayed-collection & args)

Returns a map with all documents in the collection as delays in the form {:document-key (delay (document/get document-name)) ...}.

If you want to retreive the content of a document, just dereference it like so: @(get delayed-collection 'document-key').

Takes the collection name as first and the database name as second argument. Both are mandatory.

Returns a map with all documents in the collection as delays in the form {:document-key (delay (document/get document-name)) ...}.

If you want to retreive the content of a document, just dereference it like so:
@(get delayed-collection 'document-key').

Takes the collection name as first and the database name as second argument. Both are mandatory.
sourceraw docstring

get-extended-infoclj

(get-extended-info & args)

Returns extended information about a collection. Forces a load of the collection.

Can be called without arguments. In that case the default collection from the default database will be used. Optionally you can pass a collection name as first and a database name as second argument.

Returns extended information about a collection. Forces a load of the collection.

Can be called without arguments. In that case the default collection from the default database will be used.
Optionally you can pass a collection name as first and a database name as second argument.
sourceraw docstring

get-extended-info-countclj

(get-extended-info-count & args)

Returns extended information about a collection including the number of documents in the collection. Forces a load of the collection.

Can be called without arguments. In that case the default collection from the default database will be used. Optionally you can pass a collection name as first and a database name as second argument.

Returns extended information about a collection including the number of documents in the collection.
Forces a load of the collection.

Can be called without arguments. In that case the default collection from the default database will be used.
Optionally you can pass a collection name as first and a database name as second argument.
sourceraw docstring

get-extended-info-figuresclj

(get-extended-info-figures & args)

Returns extended information about a collection including detailed information about the documents in the collection. Forces a load of the collection.

Can be called without arguments. In that case the default collection from the default database will be used. Optionally you can pass a collection name as first and a database name as second argument.

Returns extended information about a collection including detailed information about the documents in the collection.
Forces a load of the collection.

Can be called without arguments. In that case the default collection from the default database will be used.
Optionally you can pass a collection name as first and a database name as second argument.
sourceraw docstring

get-infoclj

(get-info & args)

Returns information about a collection.

Can be called without arguments. In that case the default collection from the default database will be used. Optionally you can pass a collection name as first and a database name as second argument.

Returns information about a collection.

Can be called without arguments. In that case the default collection from the default database will be used.
Optionally you can pass a collection name as first and a database name as second argument.
sourceraw docstring

load-memclj

(load-mem & args)

Loads a collection into the memory. Returns the collection on success. (?)

Can be called without arguments. In that case the default collection from the default database will be loaded. Optionally you can pass a collection name, a database name and a map with options as arguments. Possible options in the options map are: {'count' true/false}

  • count meaning if the return value should contain the number of documents in the collection -> the default is true, but setting it to false may speed up the request

The option map might be passed in an arbitrary position between the other arguments.

Loads a collection into the memory. Returns the collection on success. (?)

Can be called without arguments. In that case the default collection from the default database will be loaded.
Optionally you can pass a collection name, a database name and a map with options as arguments.
Possible options in the options map are:
{'count' true/false}
- count meaning if the return value should contain the number of documents in the collection
  -> the default is true, but setting it to false may speed up the request

The option map might be passed in an arbitrary position between the other arguments.
sourceraw docstring

modify-propertiesclj

(modify-properties properties & args)

Modifies the properties of a collection.

As first argument expects a map with options. Takes optional a collection name and a db name as further arguments. If omitted by user, the default db and collection will be used.

Possible options in the options map are: {'waitForSync' true/false 'journalSize' size}

  • waitForSync meaning if the server response should wait until the document is saved to disk
  • journalSize is the size (in bytes) for new journal files that are created for the collection
Modifies  the properties of a collection.

As first argument expects a map with options.
Takes optional a collection name and a db name as further arguments.
If omitted by user, the default db and collection will be used.

Possible options in the options map are:
{'waitForSync' true/false 'journalSize' size}
- waitForSync meaning if the server response should wait until the document is saved to disk
- journalSize is the size (in bytes) for new journal files that are created for the collection
sourceraw docstring

renameclj

(rename new-name collection-name & args)

Renames a collection. On success return a map with properties.

First argument: The new collection name Second argument: The old collection name

Takes optional a db name as further argument. If omitted by user, the default db will be used.

Renames a collection. On success return a map with properties.

First argument: The new collection name
Second argument: The old collection name

Takes optional a db name as further argument.
If omitted by user, the default db will be used.
sourceraw docstring

rotateclj

(rotate & args)

Rotates the journal of a collection. This means the current journal of the collection will be closed and all data made read-only in order to compact it. New documents will be stored in a new journal.

Can be called without arguments. In that case the default collection from the default database will be rotated. Optionally you can pass a collection name as first and a database name as second argument.

Rotates the journal of a collection. 
This means the current journal of the collection will be closed and all
data made read-only in order to compact it. New documents will be stored in a new journal.

Can be called without arguments. In that case the default collection from the default database will be rotated.
Optionally you can pass a collection name as first and a database name as second argument.
sourceraw docstring

truncateclj

(truncate & args)

Removes all documents from a collection, but leaves the indexes intact.

Can be called without arguments. In that case the default collection from the default database will be truncated. Optionally you can pass a collection name as first and a database name as second argument.

Removes all documents from a collection, but leaves the indexes intact.

Can be called without arguments. In that case the default collection from the default database will be truncated.
Optionally you can pass a collection name as first and a database name as second argument.
sourceraw docstring

unload-memclj

(unload-mem & args)

Removes a collection from the memory. On success a map containing collection properties is returned.

Can be called without arguments. In that case the default collection from the default database will be truncated. Optionally you can pass a collection name as first and a database name as second argument.

Removes a collection from the memory. On success a map containing collection properties is returned.

Can be called without arguments. In that case the default collection from the default database will be truncated.
Optionally you can pass a collection name as first and a database name as second argument.
sourceraw docstring

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

× close