How to access firestore in dart on server side
169
I found this package firedart. And also managed to retrieve data from my firestore project using it.
import 'package:firedart/firedart.dart';
String pi = 'example-app';
void main(List<String> arguments) async {
Firestore.initialize(pi);
var map = await Firestore.instance.collection("users").get();
print(map);
}
Author by
Mahan Marwat
Updated on January 03, 2023Comments
-
Mahan Marwat over 1 year
I am looking for a package/library or any helpful documentation to use firestore on the server-side in dart.
There is this firebase-admin SDK available for other platforms like Python/Java/Go etc but no implementation for Dart. Two/three packages are available for Dart that can do that but they seem dead.
A googleapi's package for dart also have a firestore package but no documentation to start with. Any kind of help would be appreciated. -
Mahan Marwat about 2 yearsI didn't get it. ??
-
New-Way about 2 yearsTell me about your Dart application, I'll explain better by using examples for your use-case.
-
Mahan Marwat about 2 yearsI have a dart package that I am using in flutter. So basically users can store data to firestore using my flutter app. I do perform some operations using my dart package in flutter. Now I want to perform some operations on the server side using the same dart library that I have written. So I am looking for a way to connect to my firestore database without flutter.
-
New-Way about 2 yearsRight, one of the options is to have a compatible NodeJS API communicate with the Dart package, like so
Firestore <-- NodeJS API (or preferred lang) --> Dart Package
I think the difficulty of the task rises dramatically since it's not centralized to your use-case. Perhaps users can create their own? Or maybe you can route them through your own API but like I said this would add a lot of work, but there's also opportunity for you if this library is essential to users. Would the Dart application connect to the user's own firestore db or your firestore db?