I'm trying to learn Go and I wrote a little code that handles a MongoDB test database, inserting some general "items". This is the code:
https://pastebin.com/ptNwKbk2
I can insert and update records without issues but when I try to FindOne or Find a record what comes out is some empty shell, it finds the record but the record only shows its id.
First Find [line 89]:
err = collection.FindOne(context.TODO(), filter).Decode(&resultItem)
Result:
Found a single document: {ID:ObjectID("5cb488c30eeb652e64ecdaeb") itemID: priority:0 desc:}
Second Find [line 95]:
cur, err := collection.Find(context.TODO(), emptyFilter, findOptions)
Result, every element has an id but no data inside ("itemID: priority:0 desc:"):
Found multiple documents (array of pointers): [0xc00004c840 0xc00004c8c0]
Could someone find what the problem is here?
Thanks in advance