Firestore ODM Feedback #7475
Replies: 69 comments 176 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 : |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
-
Great! Really what I want to. Maybe future, any built_value support plan have? |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
Great package! May I ask will this support pagination with the builder? |
Beta Was this translation helpful? Give feedback.
-
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! |
Beta Was this translation helpful? Give feedback.
-
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! |
Beta Was this translation helpful? Give feedback.
-
Hi :) |
Beta Was this translation helpful? Give feedback.
-
Nice work with this package but I have an issue. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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! |
Beta Was this translation helpful? Give feedback.
-
When using an enum field it seems that the autogenerated |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
How can I reference the document id on the |
Beta Was this translation helpful? Give feedback.
-
Has anyone ran a test to see if the generated code is mostly tree shaken ? |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Hi! Are there any plans to support enums? 👀 |
Beta Was this translation helpful? Give feedback.
-
Hello everyone. |
Beta Was this translation helpful? Give feedback.
-
Hi @rrousselGit I am using Isar and odm for the same class and they both have the class |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
I got |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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(); |
Beta Was this translation helpful? Give feedback.
-
i am getting looks like its not generating that or I am missing something my environment environment: dev_dependencies: dependencies: |
Beta Was this translation helpful? Give feedback.
-
I'm curious about the current status of cloud_firestore_odm. Is it still actively maintained? Has maintenance ceased following this transition? |
Beta Was this translation helpful? Give feedback.
-
_$EntryModelFieldMap['name'] Undefined name '_$EntryModelFieldMap' Why is this error in generated code |
Beta Was this translation helpful? Give feedback.
-
I am interested in the last tagged version: Does that mean it is close(ish) to an RC or did you start with |
Beta Was this translation helpful? Give feedback.
-
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!
Beta Was this translation helpful? Give feedback.
All reactions