diff --git a/lib/src/doc/pluck.rs b/lib/src/doc/pluck.rs index 226a2e2f..2b0b20fd 100644 --- a/lib/src/doc/pluck.rs +++ b/lib/src/doc/pluck.rs @@ -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) } diff --git a/lib/src/sql/paths.rs b/lib/src/sql/paths.rs index 819ebe4a..b64536fd 100644 --- a/lib/src/sql/paths.rs +++ b/lib/src/sql/paths.rs @@ -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("__")]);