MongoChangeStreamCursor<ChangeStreamDocument<Document>> cursor = col.watch().cursor();
System.out.println("Watching stream");
ChangeStreamDocument<Document> next = cursor.next();
assert next.getUpdateDescription() != null;
System.out.println("Database has been updated! --> " + next.getUpdateDescription().getUpdatedFields());
BasicDBObject query = new BasicDBObject();
I get the updated fields that get updated but what I want to do is get the table that was updated, you can do that by just using getUpdateDescription() method, however, it returns all of it as a json and I cant compare an entire set of json objects with a player that is currently on the server, I need to get the single string text found in "name" for whatever was updated and then I need to compare and see if the name in the updated field is equal to a user that is online on the server,
https://paste.md-5.net/uqesaquwuq.cs
In this website the code that I pasted is what gets all user columns that have "Name" and its seeing if whatever is in that field is equal to an online user, it is, however, I only want to select which table was updated and see the name inside whatever table was updated and compare that with the user that is online, so only the table that I update and has a specific user in it, if that specific user is online then send them a message saying their perms have been updated.