How do I interrogate the response to find update count – findOneAndReplace?

I have the following code snippet. It works for me and runs in a function.
How do I interrogate the response to see if the doc was updated or not ?
If I am correct, the count should be 1 if updated or 0 (if the update ran, but did not update as same data)


const options = { "returnNewDocument": false };
return collection.findOneAndReplace(query, replacement, options)
            .then(replacedDocument => {
                if(replacedDocument) {
                    console.log(`Successfully replaced the following document: ${replacedDocument}.`);
                    response.setStatusCode(200); // Set an HTTP Status code like "200 - created"
                    response.setBody(JSON.stringify({  "code": 200, "message": "update ok", "timestamp": dateBob }));
                } else {
                    console.log("No document matches the provided query.")
                    response.setStatusCode(400); // Set an HTTP Status code like "400 "
                    response.setBody(JSON.stringify({  "code": 400, "message": "update error A", "timestamp": dateBob }));
                }
                // return updatedDocument
            })
            .catch(err => {
                    console.error(`Failed to find and replace document: ${err}`)
                    response.setStatusCode(400); // Set an HTTP Status code like "400 "
                    response.setBody(JSON.stringify({  "code": 400, "message": "update error B", "timestamp": dateBob }));
                }
            )