Skip to content

kyawmyintthein/mongopaging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mongopaging

Mongo paging library using mongo-go-driver.

Demo

  pagingQuery := New(db, "users")
  pagingQuery.Find(bson.M{"email": bson.M{"$ne": ""}}).Limit(10).Sort("-created_at")
  results, cur, err := pagingQuery.Decode(context.Background())
  
  var users []UserModelResp
  for _, raw := range results {
	var user UserModelResp
	bson.Unmarshal(raw, &user)
	users = append(users, user)
  }

Releases

No releases published

Packages

No packages published

Languages