The entity.toObject( ) method returns an object which has been built from the entity. Property names in the object match attribute names of the entity.
In the filter parameter, you pass the entity attribute(s) to extract. Two syntaxes are allowed:
a string with property paths separated with commas: "propertyPath1, propertyPath2, ...".
a collection of strings: ["propertyPath1","propertyPath2";...]
If filter is specified for attributes of the relatedEntity kind:
propertyPath = "relatedEntity" -> it is extracted with simple form: an object with property __KEY (primary key).
propertyPath = "relatedEntity.*" -> all the properties are extracted
propertyPath = "relatedEntity.propertyName1; relatedEntity.propertyName2; ..." -> only those properties are extracted
If filter is specified for attributes of the relatedEntities kind:
propertyPath = "relatedEntities.*" -> all the properties are extracted
propertyPath = "relatedEntities.propertyName1; relatedEntities.propertyName2; ..." -> only those properties are extracted
If the filter parameter contains an empty string or "*", the returned object will contain:
all storage entity attributes
attributes of the relatedEntity kind: you get a property with the same name as the related entity (name of the many-to-one link). Attribute is extracted with the simple form.
attributes of the relatedEntities kind: attribute is not returned.
In the options parameter, you can pass the dk with primary key and/or dk with stamp selector(s) to add the entity's primary keys and/or stamps in extracted objects.