mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-07-19 22:18:03 +00:00
Updates to update screen
- Code example for update - Nice default operators - Fixed memory leak
This commit is contained in:
@ -56,7 +56,8 @@ func (a *App) UpdateItems(hostKey, dbKey, collKey string, formJson string) int64
|
||||
|
||||
for _, param := range form.Parameters {
|
||||
var unmarshalled bson.M
|
||||
if json.Unmarshal([]byte(param.Value), &unmarshalled) == nil {
|
||||
err = json.Unmarshal([]byte(param.Value), &unmarshalled)
|
||||
if err == nil {
|
||||
update[param.Type] = unmarshalled
|
||||
} else {
|
||||
fmt.Println(err.Error())
|
||||
@ -72,8 +73,6 @@ func (a *App) UpdateItems(hostKey, dbKey, collKey string, formJson string) int64
|
||||
var result *mongo.UpdateResult
|
||||
options := mongoOptions.Update().SetUpsert(form.Upsert)
|
||||
|
||||
fmt.Println(query, update)
|
||||
|
||||
if form.Many {
|
||||
result, err = client.Database(dbKey).Collection(collKey).UpdateMany(ctx, query, update, options)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user