()
| 77 | } |
| 78 | |
| 79 | func Example_openCollectionFromURL() { |
| 80 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. |
| 81 | // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/docstore/gcpfirestore" |
| 82 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. |
| 83 | ctx := context.Background() |
| 84 | |
| 85 | // docstore.OpenCollection creates a *docstore.Collection from a URL. |
| 86 | const url = "firestore://projects/my-project/databases/(default)/documents/my-collection?name_field=userID" |
| 87 | coll, err := docstore.OpenCollection(ctx, url) |
| 88 | if err != nil { |
| 89 | log.Fatal(err) |
| 90 | } |
| 91 | defer coll.Close() |
| 92 | } |
nothing calls this directly
no test coverage detected