search

Home  >  Q&A  >  body text

MongoDB fuzzy query

For example, a collection contains information extracted from apache logs. Then now I want to fuzzy query about '23', and then do I have to query all fields?
Because it is possible that this keyword exists in these fields?

Example mongodb fields and values

    name:'23',
    ip:'192.123.1.1',
    docs:'hahah1234',

Regarding the fuzzy query, I have considered all fields, but I don’t know if this idea is reasonable. Is there any other way?
Thank you~!

仅有的幸福仅有的幸福2805 days ago696

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-02 09:27:45

    Please refer to MongoDB’s full-text search (Text Search) function.

    The link to the official documentation is as follows:

    https://docs.mongodb.com/manu...

    For reference.

    Love MongoDB! Have Fun!

    reply
    0
  • Cancelreply