diegogub / aranGO

Golang driver for ArangoDB
Apache License 2.0
125 stars 31 forks source link

DB - fails to initialize existing collections - end up with duplicate error #33

Open prasad83 opened 8 years ago

prasad83 commented 8 years ago

db.ColExist("colname") returns false on each run - but attempt to create leads to error and blocks.

Session.DB -> intends to loadCollection into Database through the call Collections(&db) which is defined in collections.go

    res, err = db.get("collection?excludeSystem=true", "", "GET", nil, db, db)

This call works well but db does not get initialized with expected Collections due to missing tag for json decoding.

The fix below worked.


type Database struct {
    Name        string `json:"name"`
    Id          string `json:"id"`
    Path        string `json:"path"`
    System      bool   `json:"isSystem"`
    Collections []Collection `json:"result"` // FIX
    sess        *Session
    baseURL     string
}
diegogub commented 8 years ago

hello @prasad83 , which arangodb version are you using and aranGO branch? Thanks!