Checks if the document ID documentId has the same ID as equalsDocumentId, ignoring the draft prefix.
documentId
equalsDocumentId
The document ID to check
The document ID to check against
true if the document IDs are equal, false otherwise
true
false
Draft vs published document ID, but representing the same document:
// Prints "true":console.log(documentIdEquals('drafts.agot', 'agot')); Copy
// Prints "true":console.log(documentIdEquals('drafts.agot', 'agot'));
Different documents:
// Prints "false":console.log(documentIdEquals('hp-tcos', 'hp-hbp')); Copy
// Prints "false":console.log(documentIdEquals('hp-tcos', 'hp-hbp'));
Checks if the document ID
documentId
has the same ID asequalsDocumentId
, ignoring the draft prefix.