-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request(s) #117
Comments
@mands Thanks for all the feedback!
|
Also, feel free to ping us on Discord for faster turnaround! |
Hi, thanks for the reply and the questions, I'll add some code snippets that hopefully help show what I'm trying to do,
StringMap:
model: alias
type:
type: map
valueType: string
Example:
model: document
type:
type: object
fields:
name:
type: string
# this crashes
# properties:
# type: map
# valueType: string
properties1:
type: StringMap Currently uncommenting the
StringMap:
model: alias
type:
type: map
valueType: any # or unknown
Yep, of course - don't think I explained clearly, but essentially I'd like to be able to create a Document (or a object) with both known and additional fields, e.g. Example:
model: alias
type:
type: object
fields:
name:
type: string
completed:
type: boolean
github_url:
type: string
optional: true
additionalFields: true Which would allow ingesting an object such as, {
"name": "Joe Bloggs",
"completed": false,
"onboarded": true
} where
import x.y.MyModel
class TypesyncModel(x.y.MyModel):
...
class Example(TypesyncModel):
... Hope that helps - thanks again for the project, will jump on the Discord. The security rules helpers sound great, migration support for the schemas (forward only, backwards probably not as helpful) would also be a big but great addition! |
Great, thanks for the feedback Mandeep! I'm currently awk and will reply to the other questions later today but in the meantime, to unblock you, I think for question 1, you need to define properties:
type:
type: map
valueType: string For complex types, |
Example:
model: document
type:
type: object
fields:
name:
type: string
properties:
type:
type: map
valueType: string I recognize the inner
|
Thanks for your quick replies!
Yes - you are correct, I had missed the inner Thanks for creating the other issues and the quick feedback - feel free to close this issue as needed! |
Closing this now but will update you on the other issues! |
Hi - thanks for creating this project, was looking for something to help with this exact use case as have a mixed Python BE and TS FE using Firestore with both.
Have a few feature ideas that I hope help make the library more useful (some of which already have open "Issues" so are hopefully planned):
map
as anAlias
, and then use that to aDocument
- would be great to specify on theDocument
directly (dup of Allowmap
type for document models #87?)Unknown
, orAny
type would be really useful for more freeform schemas (dup of Implementunknown
type #57?)Any
type) properties on a document, atm I am collecting them in a nested map but this makes the code more complexSome nice to haves in the future,
Pydantic
parent class orConfig
SERVER_TIMESTAMP
Thanks!
The text was updated successfully, but these errors were encountered: