nil except
This commit is contained in:
parent
ed4cb943a8
commit
9da3a7c3e6
@ -3,7 +3,6 @@ package mongo
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
@ -226,7 +225,6 @@ func (m *MongoDB) StoreOne(obj interface{}, id string, collection_name string) (
|
||||
bson.Unmarshal(b, &doc)
|
||||
doc["_id"] = id
|
||||
targetDBCollection := CollectionMap[collection_name]
|
||||
fmt.Println("DB", collection_name, targetDBCollection, CollectionMap)
|
||||
MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
@ -285,7 +283,6 @@ func (m *MongoDB) Search(filters *dbs.Filters, collection_name string) (*mongo.C
|
||||
|
||||
MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
fmt.Println("FILTER", f)
|
||||
if cursor, err := targetDBCollection.Find(
|
||||
MngoCtx,
|
||||
f,
|
||||
|
@ -1,8 +1,6 @@
|
||||
package oclib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/logs"
|
||||
@ -115,7 +113,6 @@ func LoadOne(collection LibDataEnum, id string) LibData {
|
||||
}
|
||||
|
||||
func UpdateOne(collection LibDataEnum, set map[string]interface{}, id string) LibData {
|
||||
fmt.Println(set)
|
||||
model := models.Model(collection.EnumIndex())
|
||||
d, code, err := model.GetAccessor().UpdateOne(model.Deserialize(set), id)
|
||||
if err != nil {
|
||||
@ -134,7 +131,6 @@ func DeleteOne(collection LibDataEnum, id string) LibData {
|
||||
|
||||
func StoreOne(collection LibDataEnum, object map[string]interface{}) LibData {
|
||||
model := models.Model(collection.EnumIndex())
|
||||
fmt.Println(object)
|
||||
d, code, err := model.GetAccessor().StoreOne(model.Deserialize(object))
|
||||
if err != nil {
|
||||
return LibData{Data: d, Code: code, Err: err.Error()}
|
||||
|
Loading…
Reference in New Issue
Block a user