mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 20:15:07 +08:00
Support not specifying a context
This commit is contained in:
parent
01144b2c74
commit
94809090a3
@ -24,7 +24,7 @@ use meilisearch_types::{milli, Document, Index};
|
|||||||
use mime::Mime;
|
use mime::Mime;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde_json::Value;
|
use serde_json::{Map, Value};
|
||||||
use tempfile::tempfile;
|
use tempfile::tempfile;
|
||||||
use tokio::fs::File;
|
use tokio::fs::File;
|
||||||
use tokio::io::{AsyncSeekExt, AsyncWriteExt, BufWriter};
|
use tokio::io::{AsyncSeekExt, AsyncWriteExt, BufWriter};
|
||||||
@ -629,6 +629,7 @@ pub async fn edit_documents_by_function(
|
|||||||
filter_expr: filter,
|
filter_expr: filter,
|
||||||
context: match context {
|
context: match context {
|
||||||
Some(Value::Object(m)) => Some(m),
|
Some(Value::Object(m)) => Some(m),
|
||||||
|
None => Some(Map::default()),
|
||||||
_ => {
|
_ => {
|
||||||
return Err(ResponseError::from_msg(
|
return Err(ResponseError::from_msg(
|
||||||
"The context must be an object".to_string(),
|
"The context must be an object".to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user