// Add generates a DocumentRef with a unique ID. It then creates the document
// with the given data, which can be a map[string]interface{}, a struct or a
// pointer to a struct.
//
// Add returns an error in the unlikely event that a document with the same ID
// already exists.
Add generates a DocumentRef with a unique ID. It then creates the document
with the given data, which can be a map[string]interface{}, a struct or a
pointer to a struct.

Add returns an error in the unlikely event that a document with the same ID
already exists.
// Add generates a DocumentRef with a unique ID . It then creates the document // with the given data which can be a map [ string ] interface {} a struct or a // pointer to a struct . // // Add returns an error in the unlikely event that a document with the same ID // already exists .
func (c *CollectionRef) Add(ctx context.Context, data interface{}) (*DocumentRef, *WriteResult, error) {
	d := c.NewDoc()
	wr, err := d.Create(ctx, data)
	if err != nil {
		return nil, nil, err
	}
	return d, wr, nil
}
func ( c * CollectionRef ) Add ( ctx context . Context , data interface { } ) ( * DocumentRef , * WriteResult , error ) { d := c . NewDoc ( ) wr , err := d . Create ( ctx , data ) if err != nil { return nil , nil , err } return d , wr , nil }
Add generates a DocumentRef with a unique ID.
Add generates a DocumentRef with a unique ID .