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

Convert value to a stringified JSON representation #291

Open
mekinney opened this issue Feb 6, 2021 · 0 comments
Open

Convert value to a stringified JSON representation #291

mekinney opened this issue Feb 6, 2021 · 0 comments

Comments

@mekinney
Copy link

mekinney commented Feb 6, 2021

I'm trying to figure out if there is a way to present a value as a JSON string within queried column. In the example below "recordData" has many structures in our collection. The generated drdl is literally 1000's of lines long just for that one key.

Using this simplified document:

{
       "name" : "Mike",
        "recordData" : {
    		"subject" : {
    			"txtFirstName" : "Harley",
    			"selGender" : "Male"
    		}
        },
        "state":"WA"
}

I’d like to create a drdl entry that would convert the whole object to convert the "recordData" object to a string within one sql column.
Example select would be something like this:

name, recordData, state
Mike, '{"subject":{"txtFirstName":"Harley","selGender":"Male"}}', WA

I have to believe this is possible in drdl, but I can't find it in the documentation. Ideally, below would work (but it doesn't):

- Name: recordData
  MongoType: object
  SqlName: recordData
  SqlType: varchar

I'm not sure where else to ask this and couldn't find the source code for mongsqld to figure out if it's supported.

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