G
G
gelerum2021-10-11 13:11:47
MongoDB
gelerum, 2021-10-11 13:11:47

How to insert an empty list in MongoDB using Go?

How to insert an empty list like this:

{

    "cars": [

    ]

}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gelerum, 2021-10-11
@gelerum

bson.D{{"cars", bson.A{}}}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question