From 08a740db982c0e4e6d342405d4cad5b957cd559d Mon Sep 17 00:00:00 2001 From: Dane Date: Thu, 4 Feb 2016 09:23:04 +0000 Subject: [PATCH] Fix documentation for Count() function examples Count function should pass pointer to struct rather than struct. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11ccfeb6..f1e6e4b5 100644 --- a/README.md +++ b/README.md @@ -859,7 +859,7 @@ db.Where("name = ?", "jinzhu").Or("name = ?", "jinzhu 2").Find(&users).Count(&co //// SELECT * from USERS WHERE name = 'jinzhu' OR name = 'jinzhu 2'; (users) //// SELECT count(*) FROM users WHERE name = 'jinzhu' OR name = 'jinzhu 2'; (count) -db.Model(User{}).Where("name = ?", "jinzhu").Count(&count) +db.Model(&User{}).Where("name = ?", "jinzhu").Count(&count) //// SELECT count(*) FROM users WHERE name = 'jinzhu'; (count) db.Table("deleted_users").Count(&count)