Add Collection#name()

This commit is contained in:
Alan Plum
2018-11-28 17:00:57 +01:00
parent 29794318e9
commit 3d022d90e8
2 changed files with 5 additions and 10 deletions

View File

@@ -16,6 +16,9 @@ coll.save({ username: "user" });
const doc = coll.any();
console.log(doc.username);
const coll2 = db._collection(coll.name());
console.log(coll2 === coll);
const users = coll as ArangoDB.Collection<User>;
const admin = users.firstExample({ username: "admin" })!;
users.update(admin, { password: md5("hunter2") });

View File

@@ -619,6 +619,7 @@ declare namespace ArangoDB {
interface Collection<T extends object = any> {
// Collection
name(): string;
checksum(
withRevisions?: boolean,
withData?: boolean
@@ -1503,16 +1504,7 @@ declare module "@arangodb/foxx/queues" {
function deleteQueue(name: string): boolean;
function get(name: string): Queue;
export {
createQueue as create,
deleteQueue as delete,
get,
JobOptions,
Job,
Queue,
QueueItem,
Script,
};
export { createQueue as create, deleteQueue as delete, get, JobOptions, Job, Queue, QueueItem, Script, };
}
declare module "@arangodb/foxx/graphql" {