[GODRIVER-1312] how to support export mongodb dump or export function in mongo-go-driver Created: 16/Sep/19  Updated: 23/Sep/19  Resolved: 23/Sep/19

Status: Closed
Project: Go Driver
Component/s: API, CRUD, Internal
Affects Version/s: 1.2.0
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: orange.jackylee Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to TOOLS-2367 github.com/mongodb/mongo-tools-common... Closed

 Comments   
Comment by orange.jackylee [ 19/Sep/19 ]

when go build, it failed.

Comment by orange.jackylee [ 19/Sep/19 ]
  1. github.com/mongodb/mongo-tools-common/db

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/buffered_bulk.go:83:101: cannot use "github.com/mongodb/mongo-go-driver/mongo/options".InsertMany().SetOrdered(!bb.unordered) (type *"github.com/mongodb/mongo-go-driver/mongo/options".InsertManyOptions) as type *"go.mongodb.org/mongo-driver/mongo/options".InsertManyOptions in argument to bb.collection.InsertMany

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/command.go:126:34: cannot use "github.com/mongodb/mongo-go-driver/mongo/options".RunCmd().SetReadPreference("github.com/mongodb/mongo-go-driver/mongo/readpref".Nearest()) (type *"github.com/mongodb/mongo-go-driver/mongo/options".RunCmdOptions) as type *"go.mongodb.org/mongo-driver/mongo/options".RunCmdOptions in argument to session.Database("admin").RunCommand

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/command.go:126:51: cannot use "github.com/mongodb/mongo-go-driver/mongo/readpref".Nearest() (type *"github.com/mongodb/mongo-go-driver/mongo/readpref".ReadPref) as type *"go.mongodb.org/mongo-driver/mongo/readpref".ReadPref in argument to "github.com/mongodb/mongo-go-driver/mongo/options".RunCmd().SetReadPreference

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/command.go:255:60: cannot use opts (type *"github.com/mongodb/mongo-go-driver/mongo/options".FindOneOptions) as type *"go.mongodb.org/mongo-driver/mongo/options".FindOneOptions in argument to session.Database(db).Collection(collection).FindOne

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/db.go:177:11: clientopt.SetSingle undefined (type *"github.com/mongodb/mongo-go-driver/mongo/options".ClientOptions has no field or method SetSingle)

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/db.go:179:35: cannot use opts.ReadPreference (type *"github.com/mongodb/mongo-go-driver/mongo/readpref".ReadPref) as type *"go.mongodb.org/mongo-driver/mongo/readpref".ReadPref in argument to clientopt.SetReadPreference

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/db.go:209:11: undefined: "github.com/mongodb/mongo-go-driver/mongo/options".SSLOpt

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/db.go:222:12: clientopt.SetSSL undefined (type *"github.com/mongodb/mongo-go-driver/mongo/options".ClientOptions has no field or method SetSSL)

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/db.go:234:9: undefined: mongo.NewClientWithOptions

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/namespaces.go:97:2: cannot use *mongo.Cursor value as type mongo.Cursor in return argument

../../../../../pkg/mod/github.com/mongodb/mongo-tools-common@v0.0.0/db/namespaces.go:97:2: too many errors

macbookpro:go_dirver fredlee$

Comment by Ryan Chipman [ 16/Sep/19 ]

the mongodump and mongoexport tools are open source (see the repository here). You should be able to use the tools functionality programmatically if you want.

Generated at Thu Feb 08 08:36:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.