querymen icon indicating copy to clipboard operation
querymen copied to clipboard

querying ref / nested properties

Open pantchox opened this issue 7 years ago • 5 comments

Hi,

How can i use queryman to query references schema properties? lets say i have City Model and Streets Model where

  id: 123,
  name: 'my city',
  streets: [..]
}

where streets is sub resource ref fields for example in the City Schema its defined like this:

    type: Schema.ObjectId,
    ref: 'Streets',
    field: 'cityId'
  }]

so when doing query man i want to search bit city name and streets name like so:

    term: {
      type: RegExp,
      paths: ['name', 'streets.name'],
        }
url?term="york"

so if i search for york it will give me cities that have "york" in their name and streets that have "york" in their name also.

hope i was clear,

Thanks!

pantchox avatar Nov 17 '17 09:11 pantchox

+1

lucas-subli avatar Jan 25 '18 19:01 lucas-subli

+1

yl-flyer avatar Feb 19 '18 14:02 yl-flyer

+1

j0k3rabg avatar Nov 27 '18 14:11 j0k3rabg

Anyone found a way to do this?

jorgecuevas92 avatar Jul 02 '20 17:07 jorgecuevas92

+1

tkosudi avatar Apr 19 '22 21:04 tkosudi