Godeps/_workspace/src/gopkg.in/mgo.v2/session.go
func (c *Collection) Pipe(pipeline interface{}) *Pipe {
	session := c.Database.Session
	session.m.RLock()
	batchSize := int(session.queryConfig.op.limit)
	session.m.RUnlock()
	return &Pipe{
		session:    session,
		collection: c,
		pipeline:   pipeline,
		batchSize:  batchSize,
	}
}
func (c *Collection) Pipe(pipeline interface{}) *Pipe {
	session := c.Database.Session
	session.m.RLock()
	batchSize := int(session.queryConfig.op.limit)
	session.m.RUnlock()
	return &Pipe{
		session:    session,
		collection: c,
		pipeline:   pipeline,
		batchSize:  batchSize,
	}
}
func ( c * Collection ) Pipe ( pipeline interface { } ) * Pipe { session := c . Database . Session session . m . RLock ( ) batchSize := int ( session . queryConfig . op . limit ) session . m . RUnlock ( ) return & Pipe { session : session , collection : c , pipeline : pipeline , batchSize : batchSize , } }
// Pipe prepares a pipeline to aggregate. The pipeline document
// must be a slice built in terms of the aggregation framework language.
//
// For example:
//
//     pipe := collection.Pipe([]bson.M{{"$match": bson.M{"name": "Otavio"}}})
//     iter := pipe.Iter()
//
// Relevant documentation:
//
//     http://docs.mongodb.org/manual/reference/aggregation
//     http://docs.mongodb.org/manual/applications/aggregation
//     http://docs.mongodb.org/manual/tutorial/aggregation-examples
//
Pipe prepares a pipeline to aggregate . The pipeline document must be a slice built in terms of the aggregation framework language . For example : pipe : = collection . Pipe ( [] bson . M {{ $match : bson . M { name : Otavio }}} ) iter : = pipe . Iter () Relevant documentation : http : // docs . mongodb . org / manual / reference / aggregation http : // docs . mongodb . org / manual / applications / aggregation http : // docs . mongodb . org / manual / tutorial / aggregation - examples