【发布时间】:2019-06-10 03:10:10
【问题描述】:
我正在尝试使用包含具有空字符串值的字段的 morphia 将对象保存到 MongoDb。而且我不希望将那些空字符串保存在 mongoDB 中。 例如:(Json 提到)我不希望在 Mongo 中保存诸如“addressLine2”、“postalCd2”之类的字段。
{
"_id" : ObjectId("5cf8d100fe85543cdc1e3183"),
"accountNbr" : "test Acct",
"effectiveDt" : "2019-02-19",
"entryDt" : "2019-06-06",
"expirationDt" : "2020-02-19",
"insuredMailAddress" : {
"stateCd" : "TestCd",
"cityNm" : "testCity",
"addressLine1" : "Test address Line1",
"addressLine2" : "",
"postalCd2" : ""
}
"streamLineRenewInd" : {
"code" : " "
}
}
有没有办法做到这一点。
【问题讨论】:
标签: string mongodb morphia is-empty