toJson method

String toJson({
  1. bool appendOrder = false,
  2. bool keepID = true,
})

Convert Document to Json

Some nodes, metadata and attributions might not be mapped.

Implementation

String toJson({
  //Append a list of keys containing the order of nodes
  ///
  /// This is useful if you are using something like Firebase Firestore with sorts data on creation
  bool appendOrder = false,

  ///Will retain the node id found in the document
  ///
  /// If `false` then nodes will be returned in a list
  bool keepID = true,
}) =>
    json.encode(toMap(appendOrder: appendOrder, keepID: keepID));