From 60f2df344cc945cc0bc026d268888d0384d35704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=91=9E=E5=8D=8E?= Date: Tue, 10 Oct 2017 17:46:24 +0800 Subject: [PATCH] fix doc pluck (#1) --- crud.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crud.html b/crud.html index 2a743f08..5939c36b 100644 --- a/crud.html +++ b/crud.html @@ -986,7 +986,7 @@ db.Table("users").Select("JOIN emails ON emails.user_id = users.id AND emails.email = ?", "jinzhu@example.org").Joins("JOIN credit_cards ON credit_cards.user_id = users.id").Where("credit_cards.number = ?", "411111111111").Find(&user)

Pluck

-

Query single column from a model as a map, if you want to query multiple columns, you could use Scan

+

Query single column from a model as a slice, if you want to query multiple columns, you could use Scan

var ages []int64
 db.Find(&users).Pluck("age", &ages)