Skip to content

querying ref / nested properties #59

@pantchox

Description

@pantchox

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions