DocumentDB - 从触发器内部访问另一个集合
DocumentDB - Access another Collection from inside a trigger
我想知道我是否可以访问与触发器上下文集合不同的集合中的文档。这可能吗?
例如代替这个var collection = getContext().getCollection();
也许我可以有这样的东西:var otherCollection = getCollection(colId);
触发器,就像存储过程一样,被限定在一个特定的集合中。您无法访问其他集合。
从 getContext()
返回的 context 为您提供 getCollection()
,这是您的服务器端代码注册的集合。您的触发代码只能访问上下文提供的集合。
我想知道我是否可以访问与触发器上下文集合不同的集合中的文档。这可能吗?
例如代替这个var collection = getContext().getCollection();
也许我可以有这样的东西:var otherCollection = getCollection(colId);
触发器,就像存储过程一样,被限定在一个特定的集合中。您无法访问其他集合。
从 getContext()
返回的 context 为您提供 getCollection()
,这是您的服务器端代码注册的集合。您的触发代码只能访问上下文提供的集合。