I am just started mongodb and facing issue when saving XML in string field. it add '\u0000' with each character in xml file. like
"\u0000?\u0000x\u0000m\u0000l\u0000 \u0000v\u0000e\u0000r\u0000s\u0000i\u0000o\u0000n
I need to save this XML as it is without JSON 0r BSON conversion in string field.
Till the time, I found a query to get xml back in correct format.
db.Test.find({"data":"XYZ"}).forEach(function(doc){
var xml = doc.data.replace(/\u0000/g,"");
print(xml);
})
Related
I have a problem with the Cloud DB
Message:{"defaultName":"AGCError","name":"database-server","errorCode":{"code":"2052","message":"the input object is invalid."}}
I don't know what could be the reason ?
As per the Huawei Documentation, The error code 2052, it is described as “invalid input object”. So please check your input value or object
Below might be the causes. Please check:
Check any field longer input values which you declared as string. Because string data type field maximum value range is 200 character only. If the string contains more than 200 characters, you are advised to use the Text type. Refer -
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-clouddb-data-type-0000001080815898#EN-US_TOPIC_0000001176121166__en-us_topic_0000001127251477_table2376546172218
Check the date field format. Because the date format should be (yyyy-MM-dd HH:mm:ss sss) like below
How can I represent format of 2018-01-01T17:11:11.111+06:00 in string?
I've tried yyyy-MM-dd'T'HH:mm:ss.SSS+HH:mm, but it didn't work.
It is needed for range query in elasticsearch using elastic4s.
Let' try:
YYYY-MM-dd'T'HH:mm:ss.SSSz
I suggest to you this app for check the format:
https://esddd.herokuapp.com/
I want to perform delta import fro that I need to compare my update date with Solr's last_index_time. so I have a problem to compare to two different format my format of update date is 2019-01-29T05:06:02.192Z But Solr last_index_Time format is 2019-01-30 10:07:58, So, I want to change my solr last_index_time format in my object Date format. Can anyone help me for that?
Generally, propertyWriter is used to change last_index_time format in SOLR (SOLR-2658)
<propertyWriter dateFormat="yyyy-MM-dd'T'HH:mm:ss.SSSXXX" type="SimplePropertiesWriter" filename="dataimport.properties" locale="en_US"/>
Note: Additionally, this adds a <propertyWriter /> element to DIH's data-config.xml file, allowing the user to specify the location, filename and Locale for the "data-config.properties" file.
I am making a request for data and parsing it in JSON format however I do get errors because it returns timestamps in the javascript form new Date(1500000). How do I go about fixing this issue.
I thought of using regex to put quotes around the new Date(0000000) but it doesn't seem to work. I am using RegexKitLite and SBJSON. Thanks in advance for the help
You can simply use;
value = new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
where value is your "Date(1500000)" string.
From my XML file, I got a weird string (I think it's a blob data).
It looks like this:
0x244033242D212E430D21E2E3[.......]
It's a very very long string. My DB administrator told me that it comes from the database.
How to convert this string to a valid PDF file?
Thank you very much.
Regards,
Kael
A lot depends the database's manner of storing blob data, but if the format's not too exotic then the NSData and NSPropertyListSerialization classes should be able to convert it into something manageable.