Skip to content
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

Help : Array support for mongodb Model. [Priority] #2879

Closed
mjarpitanand opened this issue May 4, 2020 · 2 comments
Closed

Help : Array support for mongodb Model. [Priority] #2879

mjarpitanand opened this issue May 4, 2020 · 2 comments

Comments

@mjarpitanand
Copy link

image

I have a field OF ARRAY datatype in mongodb, I have so somehow from keystone put value in this.

I am early in keystone, 1 day old, Please help.SORRY IF IT IS REPEATED.

@mjarpitanand
Copy link
Author

https://www.keystonejs.com/guides/custom-field-types

Can we use this to construct the Array field.

@mjarpitanand mjarpitanand changed the title Help : Array support for mongodb Model. Help : Array support for mongodb Model. [Priority] May 4, 2020
@timleslie
Copy link
Contributor

Keystone does not have a field type which corresponds to the mongoDB Array type. If you want to model something like this then you need to use a Relationship field, however please note that this will model the data using scalar ID fields in the appropriate collection. https://www.keystonejs.com/guides/relationships

You might be able to create a custom field type which solves your use case, however you might find it to be more work than taking advantage of the existing data modelling structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants