Transparent Nulls
This commit is contained in:
@@ -112,8 +112,8 @@ impl DbFtsIndex {
|
|||||||
// Try paths in order, using the first value we find
|
// Try paths in order, using the first value we find
|
||||||
for path in field.path.as_slice() {
|
for path in field.path.as_slice() {
|
||||||
let val = match extractor.query(state, path).await? {
|
let val = match extractor.query(state, path).await? {
|
||||||
|
Some(PileValue::Null) | None => continue,
|
||||||
Some(x) => x,
|
Some(x) => x,
|
||||||
None => continue,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let val = val_to_string(state, &val, path, field_name).await?;
|
let val = val_to_string(state, &val, path, field_name).await?;
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ impl CliCmd for ItemCommand {
|
|||||||
.query(&state, path)
|
.query(&state, path)
|
||||||
.await
|
.await
|
||||||
.with_context(|| format!("while extracting field {name}"))?;
|
.with_context(|| format!("while extracting field {name}"))?;
|
||||||
if let Some(v) = v {
|
if let Some(v) = v
|
||||||
|
&& !matches!(v, PileValue::Null)
|
||||||
|
{
|
||||||
let j = v
|
let j = v
|
||||||
.to_json(&state)
|
.to_json(&state)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user