mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-25 22:34:28 +01:00
allows to get names from schema
This commit is contained in:
parent
3e031d8297
commit
c3d5778aae
@ -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…
Reference in New Issue
Block a user