customCommands stored as binary data (BinData)

gbyers at indue.com.au gbyers at indue.com.au
Mon Aug 24 22:18:26 EDT 2015


Hi,

I've written a custom command that connects to an OpenVPN server & determines info about a device based on its ProvisioningCode & SerialNumber. The result of that command is always a string, yet it's stored in mongo as BinData, represented as some sort of hash. Therefore, if I create an alias for this custom command to display in the UI, the output isn't as expected. Here's an example ;

> db.devices.find({}, {_customCommands: true})
{ "_id" : "XXXXXXXXXXXXXXX", "_customCommands" : { "openvpn" : { "_value" : BinData(0,"XXXXXXXX"), "_timestamp" : ISODate("2015-08-25T01:50:31.721Z") } } }

Is there a way to coerce this into mongo as type: 'string', or do I need to decode this using a parameter renderer within the UI?


Thanks,

Grant 



More information about the Users mailing list