-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Add support for columnType in Mongoose #8723
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
Conversation
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #8723 +/- ##
==========================================
- Coverage 33.65% 25.33% -8.32%
==========================================
Files 1248 1129 -119
Lines 13765 9823 -3942
Branches 1365 563 -802
==========================================
- Hits 4632 2489 -2143
+ Misses 8243 6832 -1411
+ Partials 890 502 -388
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
|
columnType is a string and mongoose don't know what to do with it most of the time it needs a constructor. Unless you use a model in pure js and not json it won't be usable. What is the usecase in mongoose ? |
|
@alexandrebodin it was related to custom fields (the color picker from that guide I linked) I had someone test it out and it worked for them. |
|
Per our convo Alex, they won't be able to pass in the Mongo constructor without breaking the CTB but it could be done via the model.js with the attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for the addition :D
|
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: |
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
Signed-off-by: Derrick Mehaffy derrickmehaffy@gmail.com
What does it do?
Mirrors functionality of Bookshelf for custom types:
strapi/packages/strapi-connector-bookshelf/lib/build-database-schema.js
Lines 149 to 152 in 6b6c1e2
Why is it needed?
Custom fields and assigning a field a specific type in the database, such as with this guide
Related issue(s)/PR(s)
N/A reported on slack