Replies: 1 comment 2 replies
-
I moved this to a bug since Payload has some helpers for creating indexes, but othis is out scope for what we give. I'm not too familiar with the widlcardProjection option in MongoDB. It looks like this is how you need to specify indexes in older versions of MongoDB (4.2). What version of MongoDB are you using as it seems the formats for wildcard indexes has changed. Mongoose might have some more info, but I'm reading the MongoDB documents for the current version and it doesn't look like this is how you do it anymore https://www.mongodb.com/docs/v7.0/core/indexes/index-types/index-wildcard/. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Link to reproduction
No response
Describe the Bug
Programmatically creating a MongoDB text index with a wildcard works only if
wildcardProjection
key is not present withinoptions
.Background: I'd like to text index Lexical text content. Since I cannot know how deep it goes my plan was to wildcard it, though I'd probably go with explicitly indexing text nodes a couple of levels deep instead:
To Reproduce
After
payload.init()
inserver.ts
:won't create the desired index. Commenting out the
wildcardProjection
entirely creates an index as expected.Payload Version
2.3.1
Adapters and Plugins
@payloadcms/db-mongodb v1.1.0
Beta Was this translation helpful? Give feedback.
All reactions