'VB find newest document in mongo
I can find the collection:
Imports MongoDB.Driver
..
Dim client As MongoClient
client = New MongoClient("mongodb+srv://...")
Dim db = client.GetDatabase("wetterstation")
Dim collection = db.GetCollection(Of BsonDocument)("akkus")
I tested it with (copied from another question)
Dim q = New BsonDocument()
Dim f = Builders(Of BsonDocument).Projection.Include("_id")
Dim list = collection.Find(q).Project(f).ToList
then I get a list of id's of the collection.
But how can I get the newest document?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
