You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the current state, ExportCollection() loads all documents in memory before exporting them to a json file.
result, err := db.FindAll(query.NewQuery(collectionName))
if err != nil {
return err
}
docs := make([]map[string]interface{}, 0)
for _, doc := range result {
docs = append(docs, doc.AsMap())
}
jsonString, err := json.Marshal(docs)
if err != nil {
return err
}
This is far from being optimized, since collections could contain thousands or millions of documents.
Export should thus performed gradually by writing documents to the output file one by one (the ForEach() method can be used to iterate no documents).
The text was updated successfully, but these errors were encountered:
At the current state,
ExportCollection()
loads all documents in memory before exporting them to a json file.This is far from being optimized, since collections could contain thousands or millions of documents.
Export should thus performed gradually by writing documents to the output file one by one (the
ForEach()
method can be used to iterate no documents).The text was updated successfully, but these errors were encountered: