pub struct Request {
pub method: Method,
pub upsert: bool,
pub path: Vec<String>,
pub auth: Option<Auth>,
pub time: Timestamp,
pub resource: Option<Document>,
pub query: Option<Query>,
pub in_transaction: bool,
pub write_fields: Option<Vec<String>>,
pub transforms: Option<Vec<String>>,
pub auto_id: bool,
pub verify: bool,
}Expand description
One request, as rules see it.
Fields§
§method: Method§upsert: boolA create or an update without an existence precondition (a set, a patch, a transform):
whether the document exists chose the method. A denial then also lists the statements of
the other of the two, which cannot allow the write (tools/oracle/rules_writes.py,
rules_denials.py).
path: Vec<String>The path checked, from databases (a document, or for a list its collection).
auth: Option<Auth>§time: Timestamp§resource: Option<Document>The document as it would be after a create or an update, or for a verify the stored
one; None otherwise.
query: Option<Query>§in_transaction: boolrequest.inTransaction: true for every write, which the official emulator commits in
a transaction of its own, and for a read of documents in a transaction begun before it;
false for a read that begins one, and for every list, in a transaction or not
(tools/oracle/rules_request_fields.py).
write_fields: Option<Vec<String>>For a write, request.writeFields: the paths of its transforms, then those of its
update mask (None, null, for a write with neither).
transforms: Option<Vec<String>>For a write, request.transforms: the paths its field transforms change, in order
(None, null, without any).
auto_id: boolA create whose document ID the server chooses (a CreateDocument without one). The
official emulator decides it without the ID: Request::path is the collection’s,
the statements are those of the collection’s documents, with the document’s wildcard
unbound, and request.resource holds only data. request.autoId says so for a
create that is not an upsert; other writes do not have it.
verify: boolA verify of a commit (Write.verify), checked as a get of its document. request has
the keys of a write’s, request.resource the stored document (null when there is none),
as in the official emulator’s second pass, where its first has the keys of a read’s
(tools/oracle/rules_verify.py, docs/parity-exceptions.md).