It’s still not working. I’ve actually tried it multiple ways and while the unit tests pass, the production continues to fail.
My current query that validates against the unit tests:
Bson queryFilter = new Document("_id", new ObjectId(commentId)).append("email", email);
DeleteResult dr = commentCollection.deleteOne(queryFilter);
What I am noticing (via some convenient System.out.println’s to see how it’s running) is that the mflix site seems to be trying to set the comment with a pre-set ID… and then goes looking for another one anyway.
Inserted comment from mflix:
Comment{id=5ce5d9cd4a50657dd15a2355, oid=5ce5d9cd4a50657dd15a2355, text=feefee, date=Wed May 22 19:22:53 EDT 2019, email=cxlrfh3pd@4goug.8mz, name=ke5o7f60q, movieId=573a13eff29313caabdd82f3, movieObjectId=573a13eff29313caabdd82f3}
Deletes are looking for:
Document{{_id=5a9427658b0beebeb697bc39, email=g9cwpr0bf@vyg4w.y2r}}
Document{{_id=5a9427658b0beebeb697bc39, email=cxlrfh3pd@4goug.8mz}}
5a9427658b0beebeb697bc39 is a different comment within the system.