Ensure temporary metadata is removed from records when output

This commit is contained in:
Tobie Morgan Hitchcock 2022-07-16 23:22:23 +01:00
parent 8dbbcf1885
commit 0394fe5b90
2 changed files with 5 additions and 0 deletions

View file

@ -6,6 +6,7 @@ use crate::doc::Document;
use crate::err::Error;
use crate::sql::idiom::Idiom;
use crate::sql::output::Output;
use crate::sql::paths::META;
use crate::sql::permission::Permission;
use crate::sql::value::Value;
@ -73,6 +74,8 @@ impl<'a> Document<'a> {
}
}
}
// Remove metadata fields on output
out.del(ctx, opt, txn, &*META).await?;
// Output result
Ok(out)
}

View file

@ -6,3 +6,5 @@ pub static ID: Lazy<[Part; 1]> = Lazy::new(|| [Part::from("id")]);
pub static IN: Lazy<[Part; 1]> = Lazy::new(|| [Part::from("in")]);
pub static OUT: Lazy<[Part; 1]> = Lazy::new(|| [Part::from("out")]);
pub static META: Lazy<[Part; 1]> = Lazy::new(|| [Part::from("__")]);