trait ArangoCollection[F[_]] extends AnyRef
Scala API for collections, wrapping com.arangodb.ArangoCollectionAsync
Document Management
case class TestObj(_key: String, name: String) implicit val codec = DocumentCodec.derive[testObj] val collection: ArangoCollection[IO] = ??? for { _ <- collection.insertDocument(TestObj("1234", "Frank")) ex1 <- collection.documentExists("1234") // true _ <- collection.getDocument[String, TestObj]("1234") _ <- collection.deleteDocument("1234") ex2 <- collection.documentExists("1234") // false } yield ()
- F
The effect type
- Alphabetic
- By Inheritance
- ArangoCollection
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
changeProperties(props: CollectionPropertiesOptions): F[CollectionPropertiesEntity]
Changes the collection's properties to given ones
Changes the collection's properties to given ones
- See also
com.arangodb.model.CollectionPropertiesOptions
-
abstract
def
count: F[Long]
Returns the number of documents in the collection
-
abstract
def
create(options: CollectionCreateOptions = new CollectionCreateOptions): F[CollectionEntity]
Creates the collection
-
abstract
def
db: ArangoDatabase[F]
Returns the parent database of this collection
Returns the parent database of this collection
- returns
The wrapped ArangoDatabase which contains this collection
-
abstract
def
deleteDocument[T](key: String, deleteOptions: DocumentDeleteOptions = new DocumentDeleteOptions)(implicit codec: DocumentCodec[T]): F[DocumentDeleteEntity[T]]
Removed a document from the collection
Removed a document from the collection
- T
Only needed if com.arangodb.model.DocumentDeleteOptions#returnOld is set to
true
for deserializing the returned document.- key
The value of the documents
_key
property- deleteOptions
See com.arangodb.model.DocumentDeleteOptions for details
- codec
Only needed if com.arangodb.model.DocumentDeleteOptions#returnOld is set to
true
for deserializing the returned document.
-
abstract
def
deleteDocuments[T](keys: Iterable[String], deleteOptions: DocumentDeleteOptions = new DocumentDeleteOptions)(implicit codec: DocumentCodec[T]): F[Iterable[Either[Throwable, DocumentDeleteEntity[T]]]]
Batch delete documents
Batch delete documents
- See also
-
abstract
def
deleteIndex(id: String): F[Unit]
Removes an index
-
abstract
def
documentExists(key: String, options: DocumentExistsOptions = new DocumentExistsOptions): F[Boolean]
Returns true if a document with given key exists on this collection
Returns true if a document with given key exists on this collection
- key
The value of the documents
_key
property- options
See com.arangodb.model.DocumentExistsOptions for details
-
abstract
def
drop(isSystem: Boolean = false): F[Unit]
Drops (deletes) the collection
-
abstract
def
ensureFulltextIndex(fields: Iterable[String], options: FulltextIndexOptions): F[IndexEntity]
Adds a new fulltext-index if no index with this name exists
-
abstract
def
ensureGeoIndex(fields: Iterable[String], options: GeoIndexOptions): F[IndexEntity]
Adds a new geo-index if no index with this name exists
-
abstract
def
ensureHashIndex(fields: Iterable[String], options: HashIndexOptions): F[IndexEntity]
Adds a new hash-index if no index with this name exists
-
abstract
def
ensurePersistentIndex(fields: Iterable[String], options: PersistentIndexOptions): F[IndexEntity]
Adds a new persistent-index if no index with this name exists
-
abstract
def
ensureSkiplistIndex(fields: Iterable[String], options: SkiplistIndexOptions): F[IndexEntity]
Adds a new skiplist-index if no index with this name exists
-
abstract
def
exists: F[Boolean]
Returns rue if this collection exists on the server
-
abstract
def
getDocument[K, T](key: K, readOptions: DocumentReadOptions = new DocumentReadOptions)(implicit codec: DocumentCodec[T]): F[Option[T]]
Gets a document by its
_key
Gets a document by its
_key
- K
Type of the document key. If this is something other then
String
, AnyRef.toString will be used- T
Type of the document
- key
The value of the documents
_key
property- readOptions
See com.arangodb.model.DocumentReadOptions for details
-
abstract
def
getDocuments[K, T](keys: Iterable[K], readOptions: DocumentReadOptions = new DocumentReadOptions)(implicit codec: DocumentCodec[T]): F[Iterable[Either[Throwable, T]]]
Batch read documents
Batch read documents
- To do
Streaming should be supported in a later version
- See also
-
abstract
def
getIndex(id: String): F[Option[IndexEntity]]
Returns details about an index
-
abstract
def
grantAccess(user: String, permissions: Permissions): F[Unit]
Grants access to this collection
-
abstract
def
indexes: F[Iterable[IndexEntity]]
Returns a list of all indexes in this collection
-
abstract
def
info: F[CollectionEntity]
Returns information about the collection
Returns information about the collection
- See also
com.arangodb.entity.CollectionEntity
-
abstract
def
insertDocument[T](document: T, createOptions: DocumentCreateOptions = new DocumentCreateOptions)(implicit codec: DocumentCodec[T]): F[Unit]
Inserts a document into the collection
Inserts a document into the collection
This method can also be used to overwrite already existing documents with the same
_key
field. See com.arangodb.model.DocumentCreateOptions#overwrite javadoc for details. -
abstract
def
insertDocuments[T](documents: Iterable[T], createOptions: DocumentCreateOptions = new DocumentCreateOptions)(implicit codec: DocumentCodec[T]): F[Unit]
Batch insert documents into collection
Batch insert documents into collection
- See also
-
abstract
def
load: F[CollectionEntity]
Load the collection
Load the collection
- See also
-
abstract
def
name: String
Returns the collections name
-
abstract
def
permissions(user: String): F[Permissions]
Returns the permissions to this collection for the given user
-
abstract
def
properties: F[CollectionPropertiesEntity]
Returns the collection's properties
Returns the collection's properties
- See also
com.arangodb.entity.CollectionPropertiesEntity
-
abstract
def
rename(newName: String): F[CollectionEntity]
Changes the collection's name
-
abstract
def
resetAccess(user: String): F[Unit]
Resets access privileges to this collection to defaults
-
abstract
def
revision: F[CollectionRevisionEntity]
Returns the current revision
Returns the current revision
- See also
com.arangodb.entity.CollectionRevisionEntity
-
abstract
def
revokeAccess(user: String): F[Unit]
Revokes access to this collection
-
abstract
def
truncate: F[CollectionEntity]
Truncates (deletes all documents) the collection
-
abstract
def
unload: F[CollectionEntity]
Unload the collection
Unload the collection
- See also
-
abstract
def
unwrap: ArangoCollectionAsync
Access to underlying java driver's ar.ArangoCollectionAsync
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )