【问题标题】:RavenDB Studio - Patch can't find this.__document_idRavenDB Studio - 补丁找不到这个.__document_id
【发布时间】:2013-09-04 01:23:34
【问题描述】:

我正在尝试在涉及获取当前文档 ID 的 Collection 上编写补丁,并且我正在尝试对其进行测试以查看 RavenDB Studio Patch 区域中的输出,该区域可以很好地显示前后。我不明白为什么我的脚本没有按我预期的方式运行,我设法将其缩小到这一小块:

this.TestId = this.__document_id

在运行测试时我的文档的输出是:

TestId: null

但我可以看到文档 ID 是 users/1234。有谁知道在 RavenDB Studio 使用的 JavaScript 中提取文档 ID 的正确语法?

RavenDB 版本:#2230

【问题讨论】:

    标签: ravendb ravendb-studio


    【解决方案1】:

    删除“__document_id”前面的“this”。

    this.TestId = __document_id
    

    【讨论】:

    • 自从我通过谷歌找到这篇文章,你确实需要这个.__document_id。
    • @KijanaWoodard 不是在我刚刚在 build 2879 中尝试过的时候。
    • 第二个 - 在 build 2879 中,this.__document_id 不起作用,只是 __document_id 起作用。
    • 这个答案确实是正确的。我刚刚在 3.0 中测试过,__document_id 有效,而 this.__document_id 无效。
    猜你喜欢
    • 1970-01-01
    • 2014-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-06
    相关资源
    最近更新 更多