Package com.c8db.internal
Class C8CollectionImpl
- java.lang.Object
-
- com.c8db.internal.C8Executeable<E>
-
- com.c8db.internal.InternalC8Collection<C8DBImpl,C8DatabaseImpl,C8ExecutorSync>
-
- com.c8db.internal.C8CollectionImpl
-
- All Implemented Interfaces:
C8Collection,C8SerializationAccessor
public class C8CollectionImpl extends InternalC8Collection<C8DBImpl,C8DatabaseImpl,C8ExecutorSync> implements C8Collection
-
-
Field Summary
-
Fields inherited from class com.c8db.internal.InternalC8Collection
name, PATH_API_COLLECTION, PATH_API_DOCUMENT, PATH_API_INDEX
-
Fields inherited from class com.c8db.internal.C8Executeable
context, executor, util
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedC8CollectionImpl(C8DatabaseImpl db, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollectionPropertiesEntitychangeProperties(CollectionPropertiesOptions options)Changes the properties of the collectionCollectionPropertiesEntitycount()Counts the documents in a collectionCollectionPropertiesEntitycount(CollectionCountOptions options)Counts the documents in a collectionCollectionEntitycreate()Creates a collection for this collection's name, then returns collection information from the server.CollectionEntitycreate(CollectionCreateOptions options)Creates a collection with the givenoptionsfor this collection's name, then returns collection information from the server.DocumentDeleteEntity<Void>deleteDocument(String key)Deletes the document with the givenkeyfrom the collection.<T> DocumentDeleteEntity<T>deleteDocument(String key, Class<T> type, DocumentDeleteOptions options)Deletes the document with the givenkeyfrom the collection.MultiDocumentEntity<DocumentDeleteEntity<Void>>deleteDocuments(Collection<?> values)Deletes multiple documents from the collection.<T> MultiDocumentEntity<DocumentDeleteEntity<T>>deleteDocuments(Collection<?> values, Class<T> type, DocumentDeleteOptions options)Deletes multiple documents from the collection.StringdeleteIndex(String id)Deletes the index with the givenidfrom the collection.BooleandocumentExists(String key)Checks if the document exists by reading a single document headBooleandocumentExists(String key, DocumentExistsOptions options)Checks if the document exists by reading a single document headvoiddrop()Deletes the collection from the database.voiddrop(boolean isSystem)Deletes the collection from the database.IndexEntityensureFulltextIndex(Iterable<String> fields, FulltextIndexOptions options)Creates a fulltext index for the collection, if it does not already exist.IndexEntityensureGeoIndex(Iterable<String> fields, GeoIndexOptions options)Creates a geo-spatial index for the collection, if it does not already exist.IndexEntityensureHashIndex(Iterable<String> fields, HashIndexOptions options)Creates a hash index for the collection if it does not already exist.IndexEntityensurePersistentIndex(Iterable<String> fields, PersistentIndexOptions options)Creates a persistent index for the collection, if it does not already exist.IndexEntityensureSkiplistIndex(Iterable<String> fields, SkiplistIndexOptions options)Creates a skip-list index for the collection, if it does not already exist.IndexEntityensureTTLIndex(Iterable<String> fields, TTLIndexOptions options)Creates a ttl index for the collection, if it does not already exist.booleanexists()Checks whether the collection exists<T> TgetDocument(String key, Class<T> type)Retrieves the document with the givenkeyfrom the collection.<T> TgetDocument(String key, Class<T> type, DocumentReadOptions options)Retrieves the document with the givenkeyfrom the collection.<T> MultiDocumentEntity<T>getDocuments(Collection<String> keys, Class<T> type)Retrieves multiple documents with the given_keyfrom the collection.<T> MultiDocumentEntity<T>getDocuments(Collection<String> keys, Class<T> type, DocumentReadOptions options)Retrieves multiple documents with the given_keyfrom the collection.IndexEntitygetIndex(String id)Fetches information about the index with the givenidand returns it.Collection<IndexEntity>getIndexes()Fetches a list of all indexes on this collection.CollectionEntitygetInfo()Returns information about the collectionPermissionsgetPermissions(String user)Get the collection access levelCollectionPropertiesEntitygetProperties()Reads the properties of the specified collectionvoidgrantAccess(String user, Permissions permissions)Grants or revoke access to the collection for user user.<T> DocumentCreateEntity<T>insertDocument(T value)Creates a new document from the given document, unless there is already a document with the _key given.<T> DocumentCreateEntity<T>insertDocument(T value, DocumentCreateOptions options)Creates a new document from the given document, unless there is already a document with the _key given.<T> MultiDocumentEntity<DocumentCreateEntity<T>>insertDocuments(Collection<T> values)Creates new documents from the given documents, unless there is already a document with the _key given.<T> MultiDocumentEntity<DocumentCreateEntity<T>>insertDocuments(Collection<T> values, DocumentCreateOptions options)Creates new documents from the given documents, unless there is already a document with the _key given.CollectionEntityrename(String newName)Renames the collection<T> DocumentUpdateEntity<T>replaceDocument(String key, T value)Replaces the document withkeywith the one in the body, provided there is such a document and no precondition is violated<T> DocumentUpdateEntity<T>replaceDocument(String key, T value, DocumentReplaceOptions options)Replaces the document withkeywith the one in the body, provided there is such a document and no precondition is violated<T> MultiDocumentEntity<DocumentUpdateEntity<T>>replaceDocuments(Collection<T> values)Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are specified by the _key attributes in the documents in values.<T> MultiDocumentEntity<DocumentUpdateEntity<T>>replaceDocuments(Collection<T> values, DocumentReplaceOptions options)Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are specified by the _key attributes in the documents in values.voidresetAccess(String user)Clear the collection access level, revert back to the default access level.voidrevokeAccess(String user)Revokes access to the collection for user user.CollectionEntitytruncate()Removes all documents from the collection, but leaves the indexes intactCollectionEntitytruncate(CollectionTruncateOptions options)Removes all documents from the collection, but leaves the indexes intact<T> DocumentUpdateEntity<T>updateDocument(String key, T value)Partially updates the document identified by document-key.<T> DocumentUpdateEntity<T>updateDocument(String key, T value, DocumentUpdateOptions options)Partially updates the document identified by document-key.<T> MultiDocumentEntity<DocumentUpdateEntity<T>>updateDocuments(Collection<T> values)Partially updates documents, the documents to update are specified by the _key attributes in the objects on values.<T> MultiDocumentEntity<DocumentUpdateEntity<T>>updateDocuments(Collection<T> values, DocumentUpdateOptions options)Partially updates documents, the documents to update are specified by the _key attributes in the objects on values.-
Methods inherited from class com.c8db.internal.InternalC8Collection
changePropertiesRequest, countRequest, createFulltextIndexRequest, createGeoIndexRequest, createHashIndexRequest, createPersistentIndexRequest, createSkiplistIndexRequest, createTTLIndexRequest, db, deleteDocumentRequest, deleteDocumentResponseDeserializer, deleteDocumentsRequest, deleteDocumentsResponseDeserializer, deleteIndexRequest, deleteIndexResponseDeserializer, documentExistsRequest, dropRequest, getDocumentRequest, getDocumentsRequest, getDocumentsResponseDeserializer, getIndexesRequest, getIndexesResponseDeserializer, getIndexRequest, getInfoRequest, getPermissionsRequest, getPermissionsResponseDeserialzer, getPropertiesRequest, getRevisionRequest, grantAccessRequest, insertDocumentRequest, insertDocumentResponseDeserializer, insertDocumentsRequest, insertDocumentsResponseDeserializer, name, renameRequest, replaceDocumentRequest, replaceDocumentResponseDeserializer, replaceDocumentsRequest, replaceDocumentsResponseDeserializer, resetAccessRequest, responsibleShardRequest, truncateRequest, updateDocumentRequest, updateDocumentResponseDeserializer, updateDocumentsRequest, updateDocumentsResponseDeserializer
-
Methods inherited from class com.c8db.internal.C8Executeable
createPath, executor, request, util, util
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.c8db.C8Collection
db, name
-
Methods inherited from interface com.c8db.C8SerializationAccessor
util, util
-
-
-
-
Constructor Detail
-
C8CollectionImpl
protected C8CollectionImpl(C8DatabaseImpl db, String name)
-
-
Method Detail
-
exists
public boolean exists() throws C8DBExceptionDescription copied from interface:C8CollectionChecks whether the collection exists- Specified by:
existsin interfaceC8Collection- Returns:
- true if the collection exists, otherwise false
- Throws:
C8DBException
-
truncate
public CollectionEntity truncate() throws C8DBException
Description copied from interface:C8CollectionRemoves all documents from the collection, but leaves the indexes intact- Specified by:
truncatein interfaceC8Collection- Returns:
- information about the collection
- Throws:
C8DBException- See Also:
- API Documentation
-
truncate
public CollectionEntity truncate(CollectionTruncateOptions options) throws C8DBException
Description copied from interface:C8CollectionRemoves all documents from the collection, but leaves the indexes intact- Specified by:
truncatein interfaceC8Collection- Returns:
- information about the collection
- Throws:
C8DBException- See Also:
- API Documentation
-
count
public CollectionPropertiesEntity count() throws C8DBException
Description copied from interface:C8CollectionCounts the documents in a collection- Specified by:
countin interfaceC8Collection- Returns:
- information about the collection, including the number of documents
- Throws:
C8DBException- See Also:
- API Documentation
-
count
public CollectionPropertiesEntity count(CollectionCountOptions options) throws C8DBException
Description copied from interface:C8CollectionCounts the documents in a collection- Specified by:
countin interfaceC8Collection- Returns:
- information about the collection, including the number of documents
- Throws:
C8DBException- See Also:
- API Documentation
-
create
public CollectionEntity create() throws C8DBException
Description copied from interface:C8CollectionCreates a collection for this collection's name, then returns collection information from the server.- Specified by:
createin interfaceC8Collection- Returns:
- information about the collection
- Throws:
C8DBException- See Also:
- API Documentation
-
create
public CollectionEntity create(CollectionCreateOptions options) throws C8DBException
Description copied from interface:C8CollectionCreates a collection with the givenoptionsfor this collection's name, then returns collection information from the server.- Specified by:
createin interfaceC8Collection- Parameters:
options- Additional options, can be null- Returns:
- information about the collection
- Throws:
C8DBException- See Also:
- API Documentation
-
drop
public void drop() throws C8DBExceptionDescription copied from interface:C8CollectionDeletes the collection from the database.- Specified by:
dropin interfaceC8Collection- Throws:
C8DBException- See Also:
- API Documentation
-
drop
public void drop(boolean isSystem) throws C8DBExceptionDescription copied from interface:C8CollectionDeletes the collection from the database.- Specified by:
dropin interfaceC8Collection- Parameters:
isSystem- Whether or not the collection to drop is a system collection. This parameter must be set to true in order to drop a system collection.- Throws:
C8DBException- See Also:
- API Documentation
-
getInfo
public CollectionEntity getInfo() throws C8DBException
Description copied from interface:C8CollectionReturns information about the collection- Specified by:
getInfoin interfaceC8Collection- Returns:
- information about the collection
- Throws:
C8DBException- See Also:
- API Documentation
-
getProperties
public CollectionPropertiesEntity getProperties() throws C8DBException
Description copied from interface:C8CollectionReads the properties of the specified collection- Specified by:
getPropertiesin interfaceC8Collection- Returns:
- properties of the collection
- Throws:
C8DBException- See Also:
- API Documentation
-
changeProperties
public CollectionPropertiesEntity changeProperties(CollectionPropertiesOptions options) throws C8DBException
Description copied from interface:C8CollectionChanges the properties of the collection- Specified by:
changePropertiesin interfaceC8Collection- Parameters:
options- Additional options, can be null- Returns:
- properties of the collection
- Throws:
C8DBException- See Also:
- API Documentation
-
rename
public CollectionEntity rename(String newName) throws C8DBException
Description copied from interface:C8CollectionRenames the collection- Specified by:
renamein interfaceC8Collection- Parameters:
newName- The new name- Returns:
- information about the collection
- Throws:
C8DBException- See Also:
- API Documentation
-
grantAccess
public void grantAccess(String user, Permissions permissions) throws C8DBException
Description copied from interface:C8CollectionGrants or revoke access to the collection for user user. You need permission to the _system database in order to execute this call.- Specified by:
grantAccessin interfaceC8Collection- Parameters:
user- The name of the userpermissions- The permissions the user grant- Throws:
C8DBException- See Also:
- API Documentation
-
revokeAccess
public void revokeAccess(String user) throws C8DBException
Description copied from interface:C8CollectionRevokes access to the collection for user user. You need permission to the _system database in order to execute this call.- Specified by:
revokeAccessin interfaceC8Collection- Parameters:
user- The name of the user- Throws:
C8DBException- See Also:
- API Documentation
-
resetAccess
public void resetAccess(String user) throws C8DBException
Description copied from interface:C8CollectionClear the collection access level, revert back to the default access level.- Specified by:
resetAccessin interfaceC8Collection- Parameters:
user- The name of the user- Throws:
C8DBException- See Also:
- API Documentation
-
getPermissions
public Permissions getPermissions(String user) throws C8DBException
Description copied from interface:C8CollectionGet the collection access level- Specified by:
getPermissionsin interfaceC8Collection- Parameters:
user- The name of the user- Returns:
- permissions of the user
- Throws:
C8DBException- See Also:
- API Documentation
-
insertDocument
public <T> DocumentCreateEntity<T> insertDocument(T value) throws C8DBException
Description copied from interface:C8CollectionCreates a new document from the given document, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Specified by:
insertDocumentin interfaceC8Collection- Parameters:
value- A representation of a single document (POJO, VPackSlice or String for JSON)- Returns:
- information about the document
- Throws:
C8DBException- See Also:
- API Documentation
-
insertDocument
public <T> DocumentCreateEntity<T> insertDocument(T value, DocumentCreateOptions options) throws C8DBException
Description copied from interface:C8CollectionCreates a new document from the given document, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Specified by:
insertDocumentin interfaceC8Collection- Parameters:
value- A representation of a single document (POJO, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- information about the document
- Throws:
C8DBException- See Also:
- API Documentation
-
insertDocuments
public <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(Collection<T> values) throws C8DBException
Description copied from interface:C8CollectionCreates new documents from the given documents, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Specified by:
insertDocumentsin interfaceC8Collection- Parameters:
values- A List of documents (POJO, VPackSlice or String for JSON)- Returns:
- information about the documents
- Throws:
C8DBException- See Also:
- API Documentation
-
insertDocuments
public <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(Collection<T> values, DocumentCreateOptions options) throws C8DBException
Description copied from interface:C8CollectionCreates new documents from the given documents, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Specified by:
insertDocumentsin interfaceC8Collection- Parameters:
values- A List of documents (POJO, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- information about the documents
- Throws:
C8DBException- See Also:
- API Documentation
-
getDocument
public <T> T getDocument(String key, Class<T> type) throws C8DBException
Description copied from interface:C8CollectionRetrieves the document with the givenkeyfrom the collection.- Specified by:
getDocumentin interfaceC8Collection- Parameters:
key- The key of the documenttype- The type of the document (POJO class, VPackSlice or String for JSON)- Returns:
- the document identified by the key
- Throws:
C8DBException- See Also:
- API Documentation
-
getDocument
public <T> T getDocument(String key, Class<T> type, DocumentReadOptions options) throws C8DBException
Description copied from interface:C8CollectionRetrieves the document with the givenkeyfrom the collection.- Specified by:
getDocumentin interfaceC8Collection- Parameters:
key- The key of the documenttype- The type of the document (POJO class, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- the document identified by the key
- Throws:
C8DBException- See Also:
- API Documentation
-
getDocuments
public <T> MultiDocumentEntity<T> getDocuments(Collection<String> keys, Class<T> type) throws C8DBException
Description copied from interface:C8CollectionRetrieves multiple documents with the given_keyfrom the collection.- Specified by:
getDocumentsin interfaceC8Collection- Parameters:
keys- The keys of the documentstype- The type of the documents (POJO class, VPackSlice or String for JSON)- Returns:
- the documents and possible errors
- Throws:
C8DBException
-
getDocuments
public <T> MultiDocumentEntity<T> getDocuments(Collection<String> keys, Class<T> type, DocumentReadOptions options) throws C8DBException
Description copied from interface:C8CollectionRetrieves multiple documents with the given_keyfrom the collection.- Specified by:
getDocumentsin interfaceC8Collection- Parameters:
keys- The keys of the documentstype- The type of the documents (POJO class, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- the documents and possible errors
- Throws:
C8DBException
-
replaceDocument
public <T> DocumentUpdateEntity<T> replaceDocument(String key, T value) throws C8DBException
Description copied from interface:C8CollectionReplaces the document withkeywith the one in the body, provided there is such a document and no precondition is violated- Specified by:
replaceDocumentin interfaceC8Collection- Parameters:
key- The key of the documentvalue- A representation of a single document (POJO, VPackSlice or String for JSON)- Returns:
- information about the document
- Throws:
C8DBException- See Also:
- API Documentation
-
replaceDocument
public <T> DocumentUpdateEntity<T> replaceDocument(String key, T value, DocumentReplaceOptions options) throws C8DBException
Description copied from interface:C8CollectionReplaces the document withkeywith the one in the body, provided there is such a document and no precondition is violated- Specified by:
replaceDocumentin interfaceC8Collection- Parameters:
key- The key of the documentvalue- A representation of a single document (POJO, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- information about the document
- Throws:
C8DBException- See Also:
- API Documentation
-
replaceDocuments
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(Collection<T> values) throws C8DBException
Description copied from interface:C8CollectionReplaces multiple documents in the specified collection with the ones in the values, the replaced documents are specified by the _key attributes in the documents in values.- Specified by:
replaceDocumentsin interfaceC8Collection- Parameters:
values- A List of documents (POJO, VPackSlice or String for JSON)- Returns:
- information about the documents
- Throws:
C8DBException- See Also:
- API Documentation
-
replaceDocuments
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(Collection<T> values, DocumentReplaceOptions options) throws C8DBException
Description copied from interface:C8CollectionReplaces multiple documents in the specified collection with the ones in the values, the replaced documents are specified by the _key attributes in the documents in values.- Specified by:
replaceDocumentsin interfaceC8Collection- Parameters:
values- A List of documents (POJO, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- information about the documents
- Throws:
C8DBException- See Also:
- API Documentation
-
updateDocument
public <T> DocumentUpdateEntity<T> updateDocument(String key, T value) throws C8DBException
Description copied from interface:C8CollectionPartially updates the document identified by document-key. The value must contain a document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.- Specified by:
updateDocumentin interfaceC8Collection- Parameters:
key- The key of the documentvalue- A representation of a single document (POJO, VPackSlice or String for JSON)- Returns:
- information about the document
- Throws:
C8DBException- See Also:
- API Documentation
-
updateDocument
public <T> DocumentUpdateEntity<T> updateDocument(String key, T value, DocumentUpdateOptions options) throws C8DBException
Description copied from interface:C8CollectionPartially updates the document identified by document-key. The value must contain a document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.- Specified by:
updateDocumentin interfaceC8Collection- Parameters:
key- The key of the documentvalue- A representation of a single document (POJO, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- information about the document
- Throws:
C8DBException- See Also:
- API Documentation
-
updateDocuments
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(Collection<T> values) throws C8DBException
Description copied from interface:C8CollectionPartially updates documents, the documents to update are specified by the _key attributes in the objects on values. Vales must contain a list of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there.- Specified by:
updateDocumentsin interfaceC8Collection- Parameters:
values- A list of documents (POJO, VPackSlice or String for JSON)- Returns:
- information about the documents
- Throws:
C8DBException- See Also:
- API Documentation
-
updateDocuments
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(Collection<T> values, DocumentUpdateOptions options) throws C8DBException
Description copied from interface:C8CollectionPartially updates documents, the documents to update are specified by the _key attributes in the objects on values. Vales must contain a list of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there.- Specified by:
updateDocumentsin interfaceC8Collection- Parameters:
values- A list of documents (POJO, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- information about the documents
- Throws:
C8DBException- See Also:
- API Documentation
-
deleteDocument
public DocumentDeleteEntity<Void> deleteDocument(String key) throws C8DBException
Description copied from interface:C8CollectionDeletes the document with the givenkeyfrom the collection.- Specified by:
deleteDocumentin interfaceC8Collection- Parameters:
key- The key of the document- Returns:
- information about the document
- Throws:
C8DBException- See Also:
- API Documentation
-
deleteDocument
public <T> DocumentDeleteEntity<T> deleteDocument(String key, Class<T> type, DocumentDeleteOptions options) throws C8DBException
Description copied from interface:C8CollectionDeletes the document with the givenkeyfrom the collection.- Specified by:
deleteDocumentin interfaceC8Collection- Parameters:
key- The key of the documenttype- The type of the document (POJO class, VPackSlice or String for JSON). Only necessary if options.returnOld is set to true, otherwise can be null.options- Additional options, can be null- Returns:
- information about the document
- Throws:
C8DBException- See Also:
- API Documentation
-
deleteDocuments
public MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(Collection<?> values) throws C8DBException
Description copied from interface:C8CollectionDeletes multiple documents from the collection.- Specified by:
deleteDocumentsin interfaceC8Collection- Parameters:
values- The keys of the documents or the documents themselves- Returns:
- information about the documents
- Throws:
C8DBException- See Also:
- API Documentation
-
deleteDocuments
public <T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(Collection<?> values, Class<T> type, DocumentDeleteOptions options) throws C8DBException
Description copied from interface:C8CollectionDeletes multiple documents from the collection.- Specified by:
deleteDocumentsin interfaceC8Collection- Parameters:
values- The keys of the documents or the documents themselvestype- The type of the documents (POJO class, VPackSlice or String for JSON). Only necessary if options.returnOld is set to true, otherwise can be null.options- Additional options, can be null- Returns:
- information about the documents
- Throws:
C8DBException- See Also:
- API Documentation
-
documentExists
public Boolean documentExists(String key)
Description copied from interface:C8CollectionChecks if the document exists by reading a single document head- Specified by:
documentExistsin interfaceC8Collection- Parameters:
key- The key of the document- Returns:
- true if the document was found, otherwise false
- See Also:
- API Documentation
-
documentExists
public Boolean documentExists(String key, DocumentExistsOptions options) throws C8DBException
Description copied from interface:C8CollectionChecks if the document exists by reading a single document head- Specified by:
documentExistsin interfaceC8Collection- Parameters:
key- The key of the documentoptions- Additional options, can be null- Returns:
- true if the document was found, otherwise false
- Throws:
C8DBException- only thrown whenDocumentExistsOptions.isCatchException()== false- See Also:
- API Documentation
-
getIndex
public IndexEntity getIndex(String id) throws C8DBException
Description copied from interface:C8CollectionFetches information about the index with the givenidand returns it.- Specified by:
getIndexin interfaceC8Collection- Parameters:
id- The index-handle- Returns:
- information about the index
- Throws:
C8DBException- See Also:
- API Documentation
-
deleteIndex
public String deleteIndex(String id) throws C8DBException
Description copied from interface:C8CollectionDeletes the index with the givenidfrom the collection.- Specified by:
deleteIndexin interfaceC8Collection- Parameters:
id- The index-handle- Returns:
- the id of the index
- Throws:
C8DBException- See Also:
- API Documentation
-
ensureHashIndex
public IndexEntity ensureHashIndex(Iterable<String> fields, HashIndexOptions options) throws C8DBException
Description copied from interface:C8CollectionCreates a hash index for the collection if it does not already exist.- Specified by:
ensureHashIndexin interfaceC8Collection- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
C8DBException- See Also:
- API Documentation
-
ensureSkiplistIndex
public IndexEntity ensureSkiplistIndex(Iterable<String> fields, SkiplistIndexOptions options) throws C8DBException
Description copied from interface:C8CollectionCreates a skip-list index for the collection, if it does not already exist.- Specified by:
ensureSkiplistIndexin interfaceC8Collection- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
C8DBException- See Also:
- API Documentation
-
ensurePersistentIndex
public IndexEntity ensurePersistentIndex(Iterable<String> fields, PersistentIndexOptions options) throws C8DBException
Description copied from interface:C8CollectionCreates a persistent index for the collection, if it does not already exist.- Specified by:
ensurePersistentIndexin interfaceC8Collection- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
C8DBException- See Also:
- API Documentation
-
ensureGeoIndex
public IndexEntity ensureGeoIndex(Iterable<String> fields, GeoIndexOptions options) throws C8DBException
Description copied from interface:C8CollectionCreates a geo-spatial index for the collection, if it does not already exist.- Specified by:
ensureGeoIndexin interfaceC8Collection- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
C8DBException- See Also:
- API Documentation
-
ensureFulltextIndex
public IndexEntity ensureFulltextIndex(Iterable<String> fields, FulltextIndexOptions options) throws C8DBException
Description copied from interface:C8CollectionCreates a fulltext index for the collection, if it does not already exist.- Specified by:
ensureFulltextIndexin interfaceC8Collection- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
C8DBException- See Also:
- API Documentation
-
ensureTTLIndex
public IndexEntity ensureTTLIndex(Iterable<String> fields, TTLIndexOptions options) throws C8DBException
Description copied from interface:C8CollectionCreates a ttl index for the collection, if it does not already exist.- Specified by:
ensureTTLIndexin interfaceC8Collection- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
C8DBException
-
getIndexes
public Collection<IndexEntity> getIndexes() throws C8DBException
Description copied from interface:C8CollectionFetches a list of all indexes on this collection.- Specified by:
getIndexesin interfaceC8Collection- Returns:
- information about the indexes
- Throws:
C8DBException- See Also:
- API Documentation
-
-