From 6c041327be7e0de883a565f5ca646e22da503a17 Mon Sep 17 00:00:00 2001 From: Marin Bek Date: Mon, 17 Nov 2014 17:04:48 +0100 Subject: [PATCH] Only set Id on document if it was given --- goes.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/goes.go b/goes.go index 5629c0c..6d737c4 100644 --- a/goes.go +++ b/goes.go @@ -478,8 +478,11 @@ func (c *Connection) Update(d Document, query map[string]interface{}, extraArgs ExtraArgs: extraArgs, method: "POST", api: "_update", - id: d.Id.(string), } + if d.Id != nil { + r.id = d.Id.(string) + } + return r.Run() }