On a similar vein to this question I am trying the example in the LiteDB documentation, and at runtime get the error:
Invalid BSON data type 'Null' on field '_id'.
My code is below, including my attempts to solve the problem, which was to add the _id and Id declaration lifted from the comments on the github, here
Public Class Customer
Public _id As LiteDB.BsonValue
Public Id As Integer
Public Name As String
Public Phones As String
Public IsActive As Boolean
End Class
Public Class ThisAddIn
Shared Sub testSub()
Dim db As New LiteDB.LiteDatabase(Directory.GetCurrentDirectory() & "\DEPDB.db")
Dim col As LiteDB.LiteCollection(Of Customer)
col = db.GetCollection(Of Customer)("customer")
Dim tCustomer As New Customer
tCustomer.Id = 1
tCustomer.Name = "John Doe"
tCustomer.Phones = "12354534"
tCustomer.IsActive = True
col.Insert(tCustomer)
end sub
end class