Closed jcsco closed 1 year ago
I'm trying to load documents from JSON. I wrote the following code.
docs := make([]*clover.Document, 0) for _, doc := range jsonObjects { docs = append(docs, clover.NewDocumentOf(*doc)) } err = db.Insert(collection, docs...) if err != nil { log.Printf("Insert error: %s\n", err.Error()) return errors.New("Write error") }
I got the following error back and it seems it's coming from badger DB. https://github.com/dgraph-io/badger/issues/441
Txn is too big to fit into one request
They suggest using the WriteBatch API (https://github.com/dgraph-io/badger/issues/1242#issuecomment-595113199). Also, this seems to have been improved in newer versions of badger DB so updating the version used in clover could work.
Can you send a PR?
Sure will take it up
Great, thank you
I'm trying to load documents from JSON. I wrote the following code.
I got the following error back and it seems it's coming from badger DB. https://github.com/dgraph-io/badger/issues/441
They suggest using the WriteBatch API (https://github.com/dgraph-io/badger/issues/1242#issuecomment-595113199). Also, this seems to have been improved in newer versions of badger DB so updating the version used in clover could work.