问题标签 [orientjs]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
orientdb - 插入顶点后不久在 orientjs 中创建边
我试图在插入顶点后在回调函数中创建一条边。下面是我使用的代码。
但它会抛出一个错误,说 Unexpected token ILLEGAL pointing to @rid。我在这里做错什么了吗?或者是否有另一种创建边缘的方法?
node.js - orientdb 中的 db 迁移 - nodejs- orientjs
我正在使用创建迁移脚本
up函数看起来像这样
}
'then' 函数没有被执行。但是这个类正在被创建。有什么遗漏吗?
我用的是orientjs版本:2.1.0 orientdb版本 2.1.6社区版
----更新----- 这是 github 问题:https ://github.com/orientechnologies/orientjs/issues/120
node.js - Orient js 我们应该使用哪种方法来创建一个新的顶点以及为什么
我正在使用 orientjs 版本:2.1.0 和 orientdb 版本 2.1.6 社区版
从 github 文档中我发现有两种方法可以创建一个新的 Vertex。
这是第一种方法
这是第二种方法
那么哪种方法是首选方法,为什么?以及何时使用 db.create 和 class.create?
我认为第一种方法更快一些,因为只有一次调用 db。如果我错了,请纠正我。
node.js - Orientdb 在另一个属性(如 slug)中使用 @rid
我正在尝试为用户添加的每个帖子创建一个 slug(prettyurl)。并使用此 slug 访问数据库中的记录。生成的 slug 可能不是唯一的,所以我想在 slug 的末尾添加 @rid。这样 slug 将是唯一的,我可以在获取记录时使用 @rid 检索记录。我也可以在 restful url 中使用这个 slug(在删除 @rid 中的 # 之后)。
那么有没有办法在插入记录时将 rid 附加到 slug 属性?
或者在 orientdb 中是否有一个自动增量字段,我可以将其与 slug 连接?
或者有没有其他方法可以达到同样的效果?我考虑过从节点 js 生成一个唯一 ID,但这可能会增加跨多个服务器创建和管理唯一字段的开销。
我在用
orientjs 版本:2.1.0
orientdb 2.1.6 版
orientdb - OrientJS:如何从查询中获取标准 JSON(序列化)
我不明白如何从 orientjs 查询中获取标准 JSON。我看到人们谈论“序列化”结果,但我不明白为什么或如何做到这一点。有一种toJSON()
方法,但我只看到它与 fetchplans 等一起使用......
我正在尝试将流传输到 csv 文件,但由于 JSON 格式不正确,它无法正常工作。
我很想解释如何以及何时进行序列化。:-)
我的查询:
我的结果:
encoding - 使用表情符号时orientjs中的编码错误
我有一些编码问题。
如果我使用简单的表情符号作为♬,它就可以工作。
对于像这样的表情符号:
如果我使用 OrientDB 控制台,我可以用表情符号字符更新一些行。
如果我使用 OrientJs,我无法让它工作:' 被转换为 ����(所以每个表情符号似乎被编码为两部分)。
如果有帮助,我正在使用 db.update('Card').set(card)... 或 db.insert('Card').set(card)...
我应该在配置中进行哪些更改以使其正常工作?如何更改数据的序列化方式?
谢谢 !
orientdb - Orientdb 获取关系作为 json 中的数组
我想获取由边缘连接的顶点,作为 json 中的属性作为数组返回。
例如:如果 POST 有 10 条评论,则查询应该返回类似这样的内容。
可以通过此查询获取数组中顶点的一个属性
这将产生一个数组,该数组在 Comment 类中只有“content”属性的值
我需要以嵌套 json 的形式获取完整记录。
更新
如果我只是out('HAS_COMMENT')
在查询中使用而不是out('HAS_COMMENT').content
,它将返回@rid
字段而不是完整记录。
orientdb - How to use array results from orientjs query in another query - array is not an "array"
I want to use an array-like result from a query, but am having trouble. I have:
So, a document is filed in a class via an edge of class filedIn.
My first query pulls a set a vertices:
I then want to select all the filedIn edges linking to any of those case vertices, but how?
{"@type":"d","@class":"matter","title":"my case","in_filedIn":["#17:7","#17:8","#17:9"],"@rid":"#12:3","@version":12}
looks like result['in_filedIn'] is an array,
but
gets me this error from back from the database:
Error on parsing command at position #0: Error parsing query: \nSELECT * FROM [object Object]\nEncountered \
(hard coded) works.
also works.
but
throws
result.in_filedIn.join is not a function
I.e. whatever kind of object it is, it's not inheriting from the Array prototype.
produces:
Bag { serialized: >'AQAAAAUAEQAAAAAAAAAHABEAAAAAAAAACAARAAAAAAAAAAkAEQAAAAAAAAAKABEAAAAAAAAADwAAAAA>AAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', uuid: null, _content: [ { [String: '#17:7'] cluster: 17, position: 7 }, ...
So I'm rather puzzled what to do.
I want to select all the edges whose @rid is listed in result.in_filedIn
Or have I misunderstood something?