CollectionEntry class
Collections enable you to store information to Stream.
This allows you to use it inside your feeds and to provide additional data for the personalized endpoints.
Examples include products and articles, but any unstructured object (e.g. JSON) is a good match for collections.
Collection entries can be embedded inside activities and used to store nested data inside activities. When doing so, Stream will automatically enrich your activities with the current version of the data (see later section).
Collection endpoints can be used both client-side and server-side except the batch methods that are only available server-side.
- Annotations
-
- @JsonSerializable()
- @DateTimeUTCConverter()
Constructors
-
CollectionEntry({String? id, String? collection, String? foreignId, Map<
String, Object> ? data, DateTime? createdAt, DateTime? updatedAt}) -
Builds a CollectionEntry.
const
-
CollectionEntry.fromJson(Map<
String, dynamic> json) -
Create a new instance from a JSON object
factory
Properties
- collection → String?
-
Collection name
final
- createdAt → DateTime?
-
When the collection object was created.
final
-
data
→ Map<
String, Object> ? -
Collection object data
final
- foreignId → String?
-
ForeignID of the collection object
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
Collection object ID
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- ref → String
-
Handy getter to refer to the collection object for enrichment purposes
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited - updatedAt → DateTime?
-
When the collection object was last updated.
final
Methods
-
copyWith(
{String? id, String? collection, String? foreignId, Map< String, Object> ? data, DateTime? createdAt, DateTime? updatedAt}) → CollectionEntry - Copies this CollectionEntry to a new instance.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serialize to JSON
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited