Stay organized with collections
Save and categorize content based on your preferences.
Properties
newIndex
newIndex: number
oldIndex
oldIndex: number
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-27 UTC.
[null,null,["Last updated 2022-07-27 UTC."],[],[],null,["- [firebase](/docs/reference/node/firebase).\n- [firestore](/docs/reference/node/firebase.firestore).\n- DocumentChange\n\\\u003c T \\\u003e \nA `DocumentChange` represents a change to the documents matching a query.\nIt contains the document affected and the type of change that occurred.\n\nType parameters\n\n-\n\n T\n\nIndex\n\nProperties\n\n- [doc](/docs/reference/node/firebase.firestore.DocumentChange#doc)\n- [newIndex](/docs/reference/node/firebase.firestore.DocumentChange#newindex)\n- [oldIndex](/docs/reference/node/firebase.firestore.DocumentChange#oldindex)\n- [type](/docs/reference/node/firebase.firestore.DocumentChange#type)\n\nProperties\n\ndoc \ndoc: [QueryDocumentSnapshot](/docs/reference/node/firebase.firestore.QueryDocumentSnapshot)\\\u003cT\\\u003e \nThe document affected by this change.\n\nnewIndex \nnewIndex: number \nThe index of the changed document in the result set immediately after\nthis `DocumentChange` (i.e. supposing that all prior `DocumentChange`\nobjects and the current `DocumentChange` object have been applied).\nIs -1 for 'removed' events.\n\noldIndex \noldIndex: number \nThe index of the changed document in the result set immediately prior to\nthis `DocumentChange` (i.e. supposing that all prior `DocumentChange` objects\nhave been applied). Is -1 for 'added' events.\n\ntype \ntype: [DocumentChangeType](/docs/reference/node/firebase.firestore#documentchangetype) \nThe type of change ('added', 'modified', or 'removed')."]]
A
DocumentChange
represents a change to the documents matching a query. It contains the document affected and the type of change that occurred.