Arangodb 版本 2.7.0.:使用 NEIGHBORS 查询时出现错误 1203
Arangodb version 2.7.0.: error 1203 when querying with NEIGHBORS
在 ArangoDB 版本 2.7.0 中拥有这个小数据集:
db._useDatabase("Test");
db._create("authors");
var john = db.authors.save({ name: { first: "John", last: "Doe" }, _key: "doe" })._id;
var frau = db.authors.save({ name: { first: "Maxima", last: "Musterfrau" }, _key: "frau" })._id;
db._create("books");
var b1 = db.books.save({ title: "The beauty of JOINS", _key: "joins" })._id;
var b2 = db.books.save({ title: "The 2nd beauty of JOINS", _key: "joinsa" })._id;
db._createEdgeCollection("written");
db.written.save(john, b1, { year: 2003 });
db.written.save(frau, b2, { year: 2001 });
查询时:
FOR b IN books
RETURN { book: b, authors: NEIGHBORS(authors, written, b._id, 'any', [], {includeData: true}) }
我收到错误:
[1203] collection not found (while executing)
在 2.6.9 版本中这工作正常。 NEIGHBORS 语法是否发生了变化,或者有人可以验证这种行为吗?
提前致谢
索伦
Referencing the NEIGHBOURS Documentation,startvertex
b._id
在vertexcollection
中查找。
但是,b._id
属于 books
,因此您无法在 authors
中查找它 - 您需要指定 books
。
实际上 2.6.9 中有一个 bug 会做错。 (也将在 2.6.10 中修复)
是的,关于错误消息肯定有改进的余地 - 敬请期待..
在 ArangoDB 版本 2.7.0 中拥有这个小数据集:
db._useDatabase("Test");
db._create("authors");
var john = db.authors.save({ name: { first: "John", last: "Doe" }, _key: "doe" })._id;
var frau = db.authors.save({ name: { first: "Maxima", last: "Musterfrau" }, _key: "frau" })._id;
db._create("books");
var b1 = db.books.save({ title: "The beauty of JOINS", _key: "joins" })._id;
var b2 = db.books.save({ title: "The 2nd beauty of JOINS", _key: "joinsa" })._id;
db._createEdgeCollection("written");
db.written.save(john, b1, { year: 2003 });
db.written.save(frau, b2, { year: 2001 });
查询时:
FOR b IN books
RETURN { book: b, authors: NEIGHBORS(authors, written, b._id, 'any', [], {includeData: true}) }
我收到错误:
[1203] collection not found (while executing)
在 2.6.9 版本中这工作正常。 NEIGHBORS 语法是否发生了变化,或者有人可以验证这种行为吗?
提前致谢 索伦
Referencing the NEIGHBOURS Documentation,startvertex
b._id
在vertexcollection
中查找。
但是,b._id
属于 books
,因此您无法在 authors
中查找它 - 您需要指定 books
。
实际上 2.6.9 中有一个 bug 会做错。 (也将在 2.6.10 中修复)
是的,关于错误消息肯定有改进的余地 - 敬请期待..