I have access to a MongoDB collection but the entries their _id is a string, a url to be exact.
I want to retrieve the next document in a collection based on the previous _id. I looked around and I've seen it's possible using the ObjectID: Finding The Next Document in MongoDb.
My problem is that the database doesn't have ObjectID's in _id, there is also no field that could possibly be used as an alternative to ObjectID (f.e. a timestamp). So how would I retrieve the next document?
Edit: Added collection example
{ "_id": random.com,
"name": "Random",
},
{ "_id": example.com,
"name": "Example",
},
{ "_id": stack.com,
"name": "Stack",
}
If I have the _id "random.com", how do I retrieve the next document, in this case the one with _id "example.com"? I'm using pymongo.