Skip to content
Browse files

Rename Collection.Query to Collection.Find

  • Loading branch information...
1 parent 4c7b725 commit 9969fbc2bf3c5be2ff1ae707d2f4fe8bafff0094 @edsrzf committed Dec 9, 2010
Showing with 5 additions and 5 deletions.
  1. +1 −1 README.md
  2. +4 −4 collection.go
View
2 README.md
@@ -37,7 +37,7 @@ Insert a document into the collection:
Query the database:
q := mongo.Query{"title": "Hello"}
- cursor := col.Query(q, 0, 0)
+ cursor := col.Find(q, 0, 0)
defer cursor.Close()
See the documentation in the source for more information.
View
8 collection.go
@@ -93,9 +93,9 @@ func (c *Collection) Insert(doc bson.Doc) os.Error {
return c.db.conn.sendMessage(2002, 0, payload)
}
-// Query searches c for any documents matching a query. It skips the first skip
+// Find searches c for any documents matching a query. It skips the first skip
// documents and limits the search to limit.
-func (c *Collection) Query(query Query, skip, limit int32) (*Cursor, os.Error) {
+func (c *Collection) Find(query Query, skip, limit int32) (*Cursor, os.Error) {
conn := c.db.conn
data, err := bson.Marshal(bson.Doc(query))
if err != nil {
@@ -125,12 +125,12 @@ func (c *Collection) Query(query Query, skip, limit int32) (*Cursor, os.Error) {
// FindAll returns all documents in c matching a query.
func (c *Collection) FindAll(query Query) (*Cursor, os.Error) {
- return c.Query(query, 0, 0)
+ return c.Find(query, 0, 0)
}
// FindOne returns the first document in c that matches a query.
func (c *Collection) FindOne(query Query) (bson.Doc, os.Error) {
- cursor, err := c.Query(query, 0, 1)
+ cursor, err := c.Find(query, 0, 1)
if err != nil {
return nil, err
}

0 comments on commit 9969fbc

Please sign in to comment.
Something went wrong with that request. Please try again.