MCPcopy
hub / github.com/dgraph-io/dgraph / ParseJSON

Function ParseJSON

chunker/json_parser.go:792–802  ·  view source on GitHub ↗

ParseJSON is a convenience wrapper function to get all NQuads in one call. This can however, lead to high memory usage. So be careful using this.

(b []byte, op int)

Source from the content-addressed store, hash-verified

790// ParseJSON is a convenience wrapper function to get all NQuads in one call. This can however, lead
791// to high memory usage. So be careful using this.
792func ParseJSON(b []byte, op int) ([]*api.NQuad, *pb.Metadata, error) {
793 buf := NewNQuadBuffer(-1)
794 err := buf.FastParseJSON(b, op)
795 if err != nil {
796 return nil, nil, err
797 }
798 buf.Flush()
799 nqs := <-buf.Ch()
800 metadata := buf.Metadata()
801 return nqs, metadata, nil
802}

Callers 1

ParseMutationObjectFunction · 0.92

Calls 5

FastParseJSONMethod · 0.95
FlushMethod · 0.95
ChMethod · 0.95
MetadataMethod · 0.95
NewNQuadBufferFunction · 0.85

Tested by

no test coverage detected