This is a tag for mongodb driver for DART programming language. This might be coupled with mongodb and dart tags.
Questions tagged [mongo-dart]
28 questions
4
votes
2 answers
Connect to MongoDB Atlas with mongo_dart
I try to connect to a MongoDB Atlas database through mongo_dart with this line of code. The provided link from MongoDB is defined by:
mongodb+srv://:@test-asdf.mongodb.net/test?retryWrites=true
throws an "Invalid scheme" Error. When…

Lukas Frey
- 85
- 1
- 8
3
votes
1 answer
(dart / flutter) using "mongo_dart" for user authentication
I was developing a medical application (meaning I have to store patient information) with flutter as the frontend and mongoDB as the backend. Is it safe to use the "mongo_dart" package for signin / signup? Or must I use another package such as…

James Kim
- 65
- 1
- 3
3
votes
0 answers
Flutter authentication WITHOUT Firebase
I would like to start a simple application in Flutter to practice with MongoDB and I would like to handle users logins/registrations with username/password storing their credentials in MongoDB.
Before today I always used Flutter together with…

Leonardo Mantovani
- 141
- 1
- 12
3
votes
1 answer
Invalid scheme in uri mongo_dart in flutter
I tried accessing a MongoDB database using the mongo_dart in flutter and it gives the following error:
"MongoDart Error: Invalid scheme in uri:" followed by the uri which is of the following form:
…

nimeni
- 43
- 2
2
votes
0 answers
Mongo Dart find documents if a property array doesn't contain an object
Here is a example where I'm creating a pipeline to a mongoDB where I'm quering for a documents where 'recieved_by' array contains a provided user.id.
`
final pipeline = AggregationPipelineBuilder()
…

branislav stojanovic
- 52
- 3
2
votes
3 answers
Get a subdocument from document with criteria Mongodb Dart
Hello I have json data like that:
{
"_id":ObjectId('5dfe907f80580559fedcc9b1'),
"companyMail":"mail@gmail.com"
"workers":[
{
"name":name,
"surName":surname,
"mail":"mail2@gmail.com",
…

Onur
- 318
- 4
- 12
2
votes
0 answers
Mongo Dart SubDocument Updating and Editing
Hello I have a data like that:
{
"_id":ObjectID(),
"field1":"field1 value",
"group1":{
{"name": "name1", "favoriteBooks":{"book1","book2"}},
{"name": "name2","favoriteBooks":{"book1","book2"}},
}
}
I want to find document by _id after that…

Onur
- 318
- 4
- 12
2
votes
1 answer
Can't add mongodart in a flutter file which contains a StatefulWidget
I'm certainly the first to ask this question because I found just nothing on the internet about this issue. When I try to import mongodart in the main file of my flutter application, I got this error in my IDE (VsCode) and also when I try to run the…

palmtreesnative
- 2,835
- 3
- 14
- 22
1
vote
1 answer
Can I use `objectId()` from `mongo_dart` to create a unique string?
I am finding a solution to create a unique string to create a file name. I realized that the ObjectId() has an id.$oid that is a unique string. But I am not sure. Is it work success full with this?
example code:
List…

Sittiphan Sittisak
- 486
- 4
- 15
1
vote
0 answers
How can I return from the server the value of a specific JSON field to a variable?
I have wrote the following code on server.
server code:
import 'dart:convert';
import 'package:mongo_dart/mongo_dart.dart';
import 'package:shelf/shelf.dart';
import 'package:shelf_web_socket/shelf_web_socket.dart';
import…

Kirsch
- 51
- 9
1
vote
1 answer
why it is not good to connect to MongoDB without an API?
I want to use mongo atlas in my flutter project and currently, I am using the mongo_dart package and I am able to add documents directly from my app.
var db = await…

Syed Rajin
- 61
- 1
- 9
1
vote
3 answers
How to build a MongoDB query that combines two field temporarily?
I have a schema which has one field named ownerId and a field which is an array named participantIds. In the frontend users can select participants. I'm using these ids to filter documents by querying the participantIds with the $all operator and…

Hard_Veur
- 401
- 1
- 4
- 12
1
vote
1 answer
How to return this crazy type in Dart?
I am trying to mock the .find function in mongo_dart and it is asking for a return function that I just can't work out. It has a type, then another type, then the name. What / how do I express this return type.
This is legitimate code…

Ryan Knell
- 6,204
- 2
- 40
- 32
1
vote
1 answer
How to access data from mongodb using flutter app
I'm building a barcode reader, which displays the name of the product after scanning its barcode. The names and the barcodes are stored in mongodb, I wrote this code for connecting to the data base:
Future

Dami Qay
- 43
- 1
- 8
0
votes
0 answers
Flutter Realm Error: Property type ObjectId not supported
I'm trying to query my MongoDB database based on the primary key, which is _id and of type ObjectId.
I get the error:
The following RealmException was thrown building Builder:
Property type ObjectId not supported
when using the code:
ObjectId id =…

Darius
- 11
- 3