mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
allows to get names from schema
This commit is contained in:
parent
3e031d8297
commit
c3d5778aae
1 changed files with 4 additions and 0 deletions
|
@ -79,6 +79,10 @@ impl Schema {
|
|||
self.fields_map.name(id)
|
||||
}
|
||||
|
||||
pub fn names(&self) -> impl Iterator<Item = &str> {
|
||||
self.fields_map.iter().map(|(k, _)| k.as_ref())
|
||||
}
|
||||
|
||||
pub fn contains(&self, name: &str) -> bool {
|
||||
self.fields_map.id(name).is_some()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue