Keystone-classic: How to pass options to mongoose schema

Created on 13 Mar 2018  ·  1Comment  ·  Source: keystonejs/keystone-classic

Expected behavior

I'm getting an error "Unknown modifier: $pushAll MongoError: Unknown modifier: $pushAll" when updating a document
Apparently the issue is resolved in mongoose v5 #4589 but the alternative is to pass { usePushEach: true } as a config option when initializing the schema but i can't figure out how to do that in keystone

Environment

| Software | Version
| ---------------- | -------
| Keystone | 4.0.0-beta.5

Most helpful comment

nvm i figured it out

keystone.List('key').schema.set('usePushEach', true);

mongoose v5 would be awesome tho

>All comments

nvm i figured it out

keystone.List('key').schema.set('usePushEach', true);

mongoose v5 would be awesome tho

Was this page helpful?
0 / 5 - 0 ratings