什么样的对象 db._collections() return ArangoDB?
What kind of object db._collections() return ArangoDB?
在 Foxx 上下文中,我使用数据库方法访问 arango 中的所有集合 db._collections()
。 return 值是一个数组。但是数组内部,每个"object"不是字符串,不是数组,不是一个object.What是它们的类型吗?
示例return:
//This is 1 array. Correct
[
//Each should be an array but they are not.
[ArangoCollection 41, "_analyzers" (type document, status loaded)],
[ArangoCollection 38, "_appbundles" (type document, status loaded)],
[ArangoCollection 31, "_apps" (type document, status loaded)],
[ArangoCollection 14, "_aqlfunctions" (type document, status loaded)],
[ArangoCollection 4, "_graphs" (type document, status loaded)],
[ArangoCollection 20, "_jobs" (type document, status loaded)],
[ArangoCollection 17, "_queues" (type document, status loaded)],
[ArangoCollection 67, "_statistics" (type document, status loaded)],
[ArangoCollection 74, "_statistics15" (type document, status loaded)],
[ArangoCollection 60, "_statisticsRaw" (type document, status loaded)],
[ArangoCollection 7, "_users" (type document, status loaded)],
[ArangoCollection 95, "animals" (type document, status loaded)],
[ArangoCollection 89, "demo" (type document, status loaded)],
[ArangoCollection 73882, "example" (type document, status loaded)]
]
db._collections()
returns ArangoCollection
个对象的数组。
您可以通过 运行 标准 JavaScript 检查方法(例如 Object.keys(...)
)了解此类对象,例如
obj = db._collections()[0];
Object.keys(obj).forEach(function(key) {
require("console").log(key + ' (' + typeof obj[key] + ')');
});
在 Foxx 上下文中,我使用数据库方法访问 arango 中的所有集合 db._collections()
。 return 值是一个数组。但是数组内部,每个"object"不是字符串,不是数组,不是一个object.What是它们的类型吗?
示例return:
//This is 1 array. Correct
[
//Each should be an array but they are not.
[ArangoCollection 41, "_analyzers" (type document, status loaded)],
[ArangoCollection 38, "_appbundles" (type document, status loaded)],
[ArangoCollection 31, "_apps" (type document, status loaded)],
[ArangoCollection 14, "_aqlfunctions" (type document, status loaded)],
[ArangoCollection 4, "_graphs" (type document, status loaded)],
[ArangoCollection 20, "_jobs" (type document, status loaded)],
[ArangoCollection 17, "_queues" (type document, status loaded)],
[ArangoCollection 67, "_statistics" (type document, status loaded)],
[ArangoCollection 74, "_statistics15" (type document, status loaded)],
[ArangoCollection 60, "_statisticsRaw" (type document, status loaded)],
[ArangoCollection 7, "_users" (type document, status loaded)],
[ArangoCollection 95, "animals" (type document, status loaded)],
[ArangoCollection 89, "demo" (type document, status loaded)],
[ArangoCollection 73882, "example" (type document, status loaded)]
]
db._collections()
returns ArangoCollection
个对象的数组。
您可以通过 运行 标准 JavaScript 检查方法(例如 Object.keys(...)
)了解此类对象,例如
obj = db._collections()[0];
Object.keys(obj).forEach(function(key) {
require("console").log(key + ' (' + typeof obj[key] + ')');
});