MCPcopy
hub / github.com/pocketbase/pocketbase / ImportCollectionsByMarshaledJSON

Method ImportCollectionsByMarshaledJSON

core/collection_import.go:18–27  ·  view source on GitHub ↗

ImportCollectionsByMarshaledJSON is the same as [ImportCollections] but accept marshaled json array as import data (usually used for the autogenerated snapshots).

(rawSliceOfMaps []byte, deleteMissing bool)

Source from the content-addressed store, hash-verified

16// ImportCollectionsByMarshaledJSON is the same as [ImportCollections]
17// but accept marshaled json array as import data (usually used for the autogenerated snapshots).
18func (app *BaseApp) ImportCollectionsByMarshaledJSON(rawSliceOfMaps []byte, deleteMissing bool) error {
19 data := []map[string]any{}
20
21 err := json.Unmarshal(rawSliceOfMaps, &data)
22 if err != nil {
23 return err
24 }
25
26 return app.ImportCollections(data, deleteMissing)
27}
28
29// ImportCollections imports the provided collections data in a single transaction.
30//

Callers

nothing calls this directly

Calls 1

ImportCollectionsMethod · 0.95

Tested by

no test coverage detected