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

Fix Search Schema for Names and Services #169

Open
Ruxuan opened this issue Jun 26, 2019 · 0 comments · May be fixed by #173
Open

Fix Search Schema for Names and Services #169

Ruxuan opened this issue Jun 26, 2019 · 0 comments · May be fixed by #173

Comments

@Ruxuan
Copy link
Contributor

Ruxuan commented Jun 26, 2019

The following search

db.getCollection('searches').find({"_id": ObjectId("5d13fa822b27ff07fe91f28d")})

returns the json below. The names and services objects are double nested in an array.

{
    "_id" : ObjectId("5d13fa822b27ff07fe91f28d"),
    "names" : [ 
        [ 
            {
                "value" : "CRYSTAL WYMENGA",
                "label" : "CRYSTAL WYMENGA",
                "First" : "CRYSTAL",
                "Last" : "WYMENGA"
            }
        ], 
        [ 
            {
                "value" : "LAURIE WISEMAN",
                "label" : "LAURIE WISEMAN",
                "First" : "LAURIE",
                "Last" : "WISEMAN"
            }
        ], 
        [ 
            {
                "value" : "NORMA WILLIAMS",
                "label" : "NORMA WILLIAMS",
                "First" : "NORMA",
                "Last" : "WILLIAMS"
            }
        ]
    ],
    "services" : [ 
        [ 
            {
                "value" : "ACS-MAIN",
                "label" : "ACS-MAIN"
            }
        ], 
        [ 
            {
                "value" : "ABA-ABA",
                "label" : "ABA-ABA"
            }
        ], 
        [ 
            {
                "value" : "BLV-MAIN",
                "label" : "BLV-MAIN"
            }
        ]
    ],
    "location" : {
        "value" : "Any",
        "label" : "Any"
    },
    "time" : {
        "value" : 30,
        "label" : "30 mins"
    },
    "numSessions" : {
        "value" : 1,
        "label" : "1"
    },
    "timeOfDay" : {
        "value" : "anytime",
        "label" : "Anytime"
    },
    "__v" : 0
}

The names field should be in the following format,

"names" : [
            {
                "value" : "CRYSTAL WYMENGA",
                ...
            },
            {
                "value" : "LAURIE WISEMAN",
                ...
            },
            {
                "value" : "NORMA WILLIAMS",
                ...
            }
]

Similarly for the services field.
Screenshot 2019-06-26 19.08.57.png

@jtaaa jtaaa linked a pull request Jun 28, 2019 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant