MCPcopy
hub / github.com/pocketbase/pocketbase / ImportCollections

Method ImportCollections

core/app.go:477–477  ·  view source on GitHub ↗

ImportCollections imports the provided collections data in a single transaction. For existing matching collections, the imported data is unmarshaled on top of the existing model. NB! If deleteMissing is true, ALL NON-SYSTEM COLLECTIONS AND SCHEMA FIELDS, that are not present in the imported config

(toImport []map[string]any, deleteMissing bool)

Source from the content-addressed store, hash-verified

475 // that are not present in the imported configuration, WILL BE DELETED
476 // (this includes their related records data).
477 ImportCollections(toImport []map[string]any, deleteMissing bool) error
478
479 // ImportCollectionsByMarshaledJSON is the same as [ImportCollections]
480 // but accept marshaled json array as import data (usually used for the autogenerated snapshots).

Callers 4

TestImportCollectionsFunction · 0.65
collectionsImportFunction · 0.65

Calls

no outgoing calls

Tested by 3

TestImportCollectionsFunction · 0.52