How to search for documents with text having character at given position

Viewed 33

For the fun, I was thinking of doing a small "helper" for wordle games. I will probably not published it, but I was searching for a small thing to do with a react + backend app, so it would be a nice test.

Therefore I would need to store a list of word of 5 letters and I would like to search every word with the letter "y" at the position "3" and e at the position "5"(for example). But I'm not so sure on how to do this with such request:

db.stores.find( { $text: { $search: "java" } } )

Is it possible to do this?

I would also need to be able to make sure the text doesn't contain some given letter or contain another at a given position.

0 Answers
Related