Reputation: 1
I just tried angulardart, I want to use mongodb as a database, I use package: mongo_dart, this is my code
can be seen, I want to retrieve data from the Mongo database "contact-db" collection "contact-collection" then display it on the console, but I get this error
"dart_sdk.js:4835 Uncaught core.UnsupportedError.new {Symbol(UnsupportedError.message): "Socket constructor", Symbol(_error): Error at Object.dart.throw (http://localhost:8080/packages/$sdk/dev_compiler/amd/dart_sdk.js:483…"
what I want to ask is:
Thank you in advance
Upvotes: 0
Views: 219
Reputation: 2524
First of all, mongodb can only be accessed from a server-side application. Saying that, you would need to create 2 applications, one for client-side written using angular-dart
and another one for the server-side using shelf
maybe.
Right now the only databases that allows connecting directly from the client-side are firebase
and firestore
.
Upvotes: 1