Skip to content

UNABLE to initialize a key in a document with an empty array! #66

@L-maple

Description

@L-maple

The background is that, the Lua's table type symbolize array and table both. So if I want to initialize a key in a document with {}, the value inserted is a table{} rather than a array []!! That brings many problems, for example:
local ret, err = exam_group_db:update({_id = _old_group_id}, {['$pushAll'] = {users = v_param.examinee_ids}})
if key users in the document is {}, the operation above will not work!!! Only if users 's value is [], the operation can work.
So how should I solve this problem? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions