Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: a single string array field is returned as multiple strings. #486

Open
or-else opened this issue Apr 10, 2020 · 1 comment
Open

Bug: a single string array field is returned as multiple strings. #486

or-else opened this issue Apr 10, 2020 · 1 comment

Comments

@or-else
Copy link
Contributor

or-else commented Apr 10, 2020

gopkg.in/rethinkdb/rethinkdb-go.v5 v5.1.0

cursor := rdb.DB("my_database").Table("test").Get("some-id").Field("stringArrayField").Run(a.conn)
var thisShoudBeAStringArray interface{}
cursor.One(&thisShoudBeAStringArray)
fmt.Println(thisShoudBeAStringArray) // Observe that it's the first element of the array

This code

for cursor.Next(&thisShoudBeAStringArray) {
	fmt.Println("hello bug!", thisShoudBeAStringArray)
}

prints a line for each element of an array when it should be a single line.

This is a Go-specific bug. It cannot be reproduces with the stock JS driver.

@or-else
Copy link
Contributor Author

or-else commented Apr 10, 2020

If I use Pluck instead of Field then everything works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant