surrealdb_core/doc/empty.rs
1use crate::ctx::Context;
2use crate::dbs::Options;
3use crate::dbs::Statement;
4use crate::doc::Document;
5use crate::err::Error;
6
7impl<'a> Document<'a> {
8 pub async fn empty(
9 &self,
10 _ctx: &Context<'_>,
11 _opt: &Options,
12 _stm: &Statement<'_>,
13 ) -> Result<(), Error> {
14 // Check if this record exists
15 if self.id.is_some() {
16 // There is no current record
17 if self.current.doc.is_none() {
18 // Ignore this requested record
19 return Err(Error::Ignore);
20 }
21 }
22 // Carry on
23 Ok(())
24 }
25}