Nikita Tokarchuk 5 years ago
parent 971977985f
commit deac951551
  1. 2
      go.mod
  2. 4
      mongox/base/getid.go
  3. 2
      mongox/base/object.go
  4. 2
      mongox/base/objectid.go
  5. 2
      mongox/base/reset.go
  6. 2
      mongox/base/string.go
  7. 6
      mongox/common/common.go
  8. 6
      mongox/common/count.go
  9. 6
      mongox/common/deletearray.go
  10. 8
      mongox/common/deleteone.go
  11. 8
      mongox/common/loadarray.go
  12. 8
      mongox/common/loadone.go
  13. 8
      mongox/common/loadstream.go
  14. 8
      mongox/common/saveone.go
  15. 4
      mongox/database/database.go
  16. 4
      mongox/query/compose.go
  17. 4
      mongox/tempdb/tempdb.go

@ -1,4 +1,4 @@
module github.com/mainnika/mongox-go-driver module github.com/mainnika/mongox-go-driver/v2
require ( require (
github.com/google/go-cmp v0.3.0 // indirect github.com/google/go-cmp v0.3.0 // indirect

@ -3,8 +3,8 @@ package base
import ( import (
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
) )
// GetID returns source document id // GetID returns source document id

@ -3,7 +3,7 @@ package base
import ( import (
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
) )
var _ mongox.BaseObject = &Object{} var _ mongox.BaseObject = &Object{}

@ -3,7 +3,7 @@ package base
import ( import (
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
) )
var _ mongox.BaseObjectID = &ObjectID{} var _ mongox.BaseObjectID = &ObjectID{}

@ -3,7 +3,7 @@ package base
import ( import (
"reflect" "reflect"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
) )
// Reset function creates new zero object for the target pointer // Reset function creates new zero object for the target pointer

@ -1,7 +1,7 @@
package base package base
import ( import (
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
) )
var _ mongox.BaseString = &String{} var _ mongox.BaseString = &String{}

@ -9,9 +9,9 @@ import (
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
"github.com/mainnika/mongox-go-driver/mongox/query" "github.com/mainnika/mongox-go-driver/v2/mongox/query"
) )
func createSimpleLoad(db mongox.Database, target interface{}, composed *query.Query) (cursor *mongo.Cursor, err error) { func createSimpleLoad(db mongox.Database, target interface{}, composed *query.Query) (cursor *mongo.Cursor, err error) {

@ -4,9 +4,9 @@ import (
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
"github.com/mainnika/mongox-go-driver/mongox/query" "github.com/mainnika/mongox-go-driver/v2/mongox/query"
) )
// Count function counts documents in the database by query // Count function counts documents in the database by query

@ -6,9 +6,9 @@ import (
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/base" "github.com/mainnika/mongox-go-driver/v2/mongox/base"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
) )
// DeleteArray removes documents list from a database by their ids // DeleteArray removes documents list from a database by their ids

@ -7,10 +7,10 @@ import (
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/base" "github.com/mainnika/mongox-go-driver/v2/mongox/base"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
"github.com/mainnika/mongox-go-driver/mongox/query" "github.com/mainnika/mongox-go-driver/v2/mongox/query"
) )
// DeleteOne removes a document from a database and then returns it into target // DeleteOne removes a document from a database and then returns it into target

@ -5,10 +5,10 @@ import (
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/base" "github.com/mainnika/mongox-go-driver/v2/mongox/base"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
"github.com/mainnika/mongox-go-driver/mongox/query" "github.com/mainnika/mongox-go-driver/v2/mongox/query"
) )
// LoadArray loads an array of documents from the database by query // LoadArray loads an array of documents from the database by query

@ -3,10 +3,10 @@ package common
import ( import (
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/base" "github.com/mainnika/mongox-go-driver/v2/mongox/base"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
"github.com/mainnika/mongox-go-driver/mongox/query" "github.com/mainnika/mongox-go-driver/v2/mongox/query"
) )
// LoadOne function loads a first single target document by a query // LoadOne function loads a first single target document by a query

@ -5,10 +5,10 @@ import (
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/base" "github.com/mainnika/mongox-go-driver/v2/mongox/base"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
"github.com/mainnika/mongox-go-driver/mongox/query" "github.com/mainnika/mongox-go-driver/v2/mongox/query"
) )
// StreamLoader is a controller for a database cursor // StreamLoader is a controller for a database cursor

@ -7,10 +7,10 @@ import (
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/base" "github.com/mainnika/mongox-go-driver/v2/mongox/base"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
"github.com/mainnika/mongox-go-driver/mongox/query" "github.com/mainnika/mongox-go-driver/v2/mongox/query"
) )
// SaveOne saves a single source document to the database // SaveOne saves a single source document to the database

@ -6,8 +6,8 @@ import (
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
) )
// Database handler // Database handler

@ -4,8 +4,8 @@ import (
"go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"github.com/mainnika/mongox-go-driver/mongox/base" "github.com/mainnika/mongox-go-driver/v2/mongox/base"
"github.com/mainnika/mongox-go-driver/mongox/errors" "github.com/mainnika/mongox-go-driver/v2/mongox/errors"
) )
// Compose is a function to compose filters into a single query // Compose is a function to compose filters into a single query

@ -8,8 +8,8 @@ import (
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
"github.com/mainnika/mongox-go-driver/mongox" "github.com/mainnika/mongox-go-driver/v2/mongox"
"github.com/mainnika/mongox-go-driver/mongox/database" "github.com/mainnika/mongox-go-driver/v2/mongox/database"
) )
// TempDB is a temporary database connection that will be destroyed after close // TempDB is a temporary database connection that will be destroyed after close

Loading…
Cancel
Save