0

クラウド内のバックエンドの変更を追跡したいと考えています。

私の before_save のログは、次のようなことを教えてくれます:

before_save triggered for Elements for user oKwM9mvEUn:
  Input: {
  "original":
    {"elements":[
        {"__type":"Pointer","className":"Element","objectId":"VzeuG3Z5N6"},
        {"__type":"Pointer","className":"Element","objectId":"APkHJpgcms"},
        {"__type":"Pointer","className":"Element","objectId":"xHG1jg8fny"}
        ]},

    "update":
    {"elements":[
      {"__type":"Pointer","className":"Element","objectId":"VzeuG3Z5N6"},
      {"__type":"Pointer","className":"Element","objectId":"xHG1jg8fny"}
      ]}
    }

  Result: Update changed to 
  {"elements":[
  {"__type":"Pointer","className":"Element","objectId":"VzeuG3Z5N6"},
  {"__type":"Pointer","className":"Element","objectId":"xHG1jg8fny"}
  ]}

dirtyKeys は、「要素」が変更されたことを示していますが、変更を追跡したいだけなので、追加 (または削除) されたものを正確に知りたいです...

これらの「更新」値にアクセスする可能性はありますか? それとも、別のプロパティで自分で追跡する必要がありますか?

ヒントをありがとう!

4

1 に答える 1

0

同様の質問に投稿したように、次を使用して関係変更の詳細を取得できます。

request.operation.op(yourFieldName)

それはオブジェクトを返しParse.Op.Relationます。

于 2015-02-25T18:45:12.117 に答える