We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should set that field for the embeddable package there:
FerretDB/ferretdb/ferretdb.go
Lines 137 to 139 in 6cda9ad
0.21.0
SQLite
Insert document
package main import ( "context" "log" "github.com/FerretDB/FerretDB/ferretdb" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" ) func main() { // start server f, err := ferretdb.New(&ferretdb.Config{ Listener: ferretdb.ListenerConfig{ TCP: "127.0.0.1:0", }, Handler: "sqlite", SQLiteURL: "file:./?mode=memory", }) if err != nil { log.Fatal(err) } ctx, cancel := context.WithCancel(context.Background()) done := make(chan struct{}) go func() { log.Print(f.Run(ctx)) close(done) }() uri := f.MongoDBURI() // start client mongoCli, _ := mongo.Connect(ctx, options.Client().ApplyURI(uri)) _, e := mongoCli.Database("test").Collection("test").InsertOne(context.TODO(), bson.M{"abc": "def"}) if e != nil { log.Print(e) } cancel() <-done }
No error
2024-04-15T15:59:25.084+0800 DPANIC // 127.0.0.1:52039 -> 127.0.0.1:52037 clientconn/conn.go:170 batch-size should be greater or equal to 1 (err = <nil>) github.com/FerretDB/FerretDB/internal/clientconn.(*conn).run.func3 C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/clientconn/conn.go:170 runtime.gopanic C:/Users/ben/scoop/apps/go/current/src/runtime/panic.go:770 github.com/FerretDB/FerretDB/internal/backends/sqlite.(*collection).InsertAll.func1 C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/backends/sqlite/collection.go:114 github.com/FerretDB/FerretDB/internal/util/fsql.(*DB).InTransaction C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/util/fsql/db.go:172 github.com/FerretDB/FerretDB/internal/backends/sqlite.(*collection).InsertAll C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/backends/sqlite/collection.go:111 github.com/FerretDB/FerretDB/internal/backends.(*collectionContract).InsertAll C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/backends/collection.go:202 github.com/FerretDB/FerretDB/internal/backends/decorators/oplog.(*collection).InsertAll C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/backends/decorators/oplog/collection.go:64 github.com/FerretDB/FerretDB/internal/handler.(*Handler).MsgInsert C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/handler/msg_insert.go:145 github.com/FerretDB/FerretDB/internal/handler.(*Handler).initCommands.(*Handler).authenticateWrapper.func1 C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/handler/commands.go:304 github.com/FerretDB/FerretDB/internal/clientconn.(*conn).handleOpMsg C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/clientconn/conn.go:575 github.com/FerretDB/FerretDB/internal/clientconn.(*conn).route C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/clientconn/conn.go:432 github.com/FerretDB/FerretDB/internal/clientconn.(*conn).run C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/clientconn/conn.go:316 github.com/FerretDB/FerretDB/internal/clientconn.acceptLoop.func1 C:/Users/ben/go/pkg/mod/github.com/!ferret!d!b/!ferret!d!b@v1.21.0/internal/clientconn/listener.go:305
Additional
0.20.1 does not have such error.
The text was updated successfully, but these errors were encountered:
@tbnguyen1407 Want to send a PR with a fix that just sets that field there?
Sorry, something went wrong.
noisersup
Successfully merging a pull request may close this issue.
We should set that field for the embeddable package there:
FerretDB/ferretdb/ferretdb.go
Lines 137 to 139 in 6cda9ad
FerretDB version
0.21.0
Backend
SQLite
Environment
What did you do?
Insert document
What did you expect to see?
No error
What did you see instead?
Additional
0.20.1 does not have such error.
The text was updated successfully, but these errors were encountered: