Firestore ODM Feedback #7475
Replies: 70 comments · 183 replies
|
The generator doesn't detect the part 'user.freezed.dart';
part 'user.g.dart';
@Collection<User>('/users/')
final usersRef = UserCollectionReference();
@freezed
class User with _$User {
const factory User({required String name}) = _User;
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
}
Error : |
This comment has been hidden.
This comment has been hidden.
|
I've played a bit with the package and it looks really promising ! Currently, nested objects (nested fields) don't seem to be supported. For example : @Collection<User>('users')
final usersRef = UserCollectionReference();
@JsonSerializable()
class User {
User({
required this.name,
required this.age,
required this.email,
});
final FullName name;
final int age;
final String email;
}
@JsonSerializable()
class FullName {
FullName({
required this.firstName,
required this.lastName,
});
final String firstName;
final String lastName;
factory FullName.fromJson(Map<String, dynamic> json) =>
_$FullNameFromJson(json);
Map<String, dynamic> toJson() => _$FullNameToJson(this);
}The "name" class member is not included in the generated |
|
Great! Really what I want to. Maybe future, any built_value support plan have? |
|
Will this support documents as well? We have a top level We can't use @Collection, we would need something like @document for single document references |
|
Great package! May I ask will this support pagination with the builder? |
|
I am facing an issue with the @collection annotation, when trying to perform the code generation. The linter says:
and the code generation says:
I am running on flutter version 2.8.0 (stable) and dart version 2.15.0 (stable). Any idea how I can fix this issue / enable 'generic-metadata'? Thanks! |
|
I also am running into some trouble with the p.s., This looks like a great addition to flutterfire. I am excited to see where it goes! |
|
Hi :) |
|
Nice work with this package but I have an issue. |
|
I am curious about database migration support. Let's say I have a model: class User {
final String email;
final String name;
}and I'd like to add a field class User {
final String email;
final String name;
final String nickname;
}will this plugin be able to help with that case? I know it's a bit of pain to do migration in Firestore. |
|
Thank you all for getting this amazing plugin done. I have a question regarding DocumentReferences(single or as a list) in a document. I am using Flutter 2.5.3 and environment is Thanks in advance! |
|
When using an enum field it seems that the autogenerated |
|
Im sorry if this is dumb. But is it a good practice to import 'part' files in others? or this is meant to be used like: user.g.part only in user class? |
|
How can I reference the document id on the |
|
I suggest removing the need for collections to be defined in the same file as jsonserializable entities. Field map is not necessarily generated and some people might see those things as separate concerns. |
|
Hi! Are there any plans to support enums? 👀 |
|
Hello everyone. |
|
Hi @rrousselGit I am using Isar and odm for the same class and they both have the class |
|
Hey all. I plan to switch using Firestore ODM to optimize some of the data retrieval for subcollections. Is the data from subcollections with firestore odm lazy? Or they are queried as soon as the paren object is queried? |
|
I got |
|
Wanted to reference this Ultimately, I'm confused why these steps to deal with reflection workarounds are necessary. I see dart packages like fake_reflection where the author has gone through the trouble to reverse engineer how to get the Dart class/function bodies as strings from a running program. Then hopefully if there is no parsing errors, the user can get back the names. If the info is there in the program, why isn't there just a way to query it directly? Then Firestore wouldn't need an extra step, and Datastore wouldn't need a mirror. |
|
ODM support enum as well as I just wanted to report this disparity, from what I understand from code it would be quit a work to come up with a |
|
It's not clear from the documentation whether a subcollection class has to be defined in the same file as the parent collection class. For example, if I have in one file: @Collection<Person>('people')
@freezed
class Person with _$Person {
@JsonSerializable()
const factory Person({
String? name,
}) = _Person;
factory Person.fromJson(Map<String, dynamic> json) => _$PersonFromJson(json);
}And in another file: @Collection<Book>('people/*/books')
@freezed
class Book with _$Book {
@JsonSerializable()
const factory Book({
int? pages,
}) = _Book;
factory Book.fromJson(Map<String, dynamic> json) => _$BookFromJson(json);
}Then I get the error Thanks. |
|
Do you plan to support batch operations? It can be similar to the transaction API you already support, e.g: final batch = FirebaseFirestore.instance.batch();
usersRef.doc('userId').batchUpdate(
batch,
name: 'New name',
ageFieldValue: FieldValue.delete(),
);
await batch.commit(); |
|
i am getting looks like its not generating that or I am missing something my environment environment: dev_dependencies: dependencies: |
|
I'm curious about the current status of cloud_firestore_odm. Is it still actively maintained? Has maintenance ceased following this transition? |
|
_$EntryModelFieldMap['name'] Undefined name '_$EntryModelFieldMap' Why is this error in generated code |
|
I am interested in the last tagged version: Does that mean it is close(ish) to an RC or did you start with |
|
Hi everyone, I've been following this discussion for a while and noticed that the official Firestore ODM development has been relatively quiet lately. Like many of you, I've encountered various limitations and issues mentioned in this thread - from nested object support to pagination, enum handling, and the general maintenance concerns. After experiencing these pain points in my own projects, I decided to take a different approach and built a new Firestore ODM from the ground up, specifically designed to address many of the issues discussed here. Key improvements include: Complete nested object support - Works seamlessly with complex data structures I've been using it in production and it's been incredibly stable. The documentation is comprehensive with detailed guides and examples. If anyone is interested in trying it out, you can find it here: https://github.com/sylphxltd/firestore_odm Full documentation: https://sylphxltd.github.io/firestore_odm/ I'd love to get feedback from the community, especially from those who've been waiting for solutions to the issues mentioned in this thread. No pressure at all - just sharing in case it helps anyone who's been stuck with similar challenges. Thanks for all the great discussions and feedback in this thread - it really helped shape the design decisions! 🙏 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We have started development of an ODM for Firestore to make storing data with Firestore easier.
Please give it a try and use this discussion to provide any feedback!
All reactions