在parse.com数据库中只添加了一个字段(Only one field is getting added in parse.com database)

编程入门 行业动态 更新时间:2024-10-27 16:35:55
在parse.com数据库中只添加了一个字段(Only one field is getting added in parse.com database)

只有最后一个字段才能保存在parse.com数据库中,任何人都可以告诉我为什么? 数据库仅保存具有地名“GE”的字段,并忽略第一个输入的数据!

ParseObject testObject = new ParseObject("locations"); ParseGeoPoint point = new ParseGeoPoint(21.177051,79.061818); //1 testObject.put("placeName", "Brand Factory"); testObject.put("address","Brand Factory,RKNEC,Nagpur"); testObject.put("locationPoint", point); testObject.put("offers", "10% on Clothing"); testObject.saveInBackground(); //2 point = new ParseGeoPoint(21.177161,79.060533); testObject.put("placeName", "G E"); testObject.put("address","G E, RKNEC, Nagpur"); testObject.put("locationPoint", point); testObject.put("offers", "20% on Shoes"); testObject.saveInBackground()

Only last field in getting saved in the parse.com database, can any one tell me why? Database only saves the field with place name "G E" and ignores the first inputted data!

ParseObject testObject = new ParseObject("locations"); ParseGeoPoint point = new ParseGeoPoint(21.177051,79.061818); //1 testObject.put("placeName", "Brand Factory"); testObject.put("address","Brand Factory,RKNEC,Nagpur"); testObject.put("locationPoint", point); testObject.put("offers", "10% on Clothing"); testObject.saveInBackground(); //2 point = new ParseGeoPoint(21.177161,79.060533); testObject.put("placeName", "G E"); testObject.put("address","G E, RKNEC, Nagpur"); testObject.put("locationPoint", point); testObject.put("offers", "20% on Shoes"); testObject.saveInBackground()

最满意答案

我认为Parse简单地覆盖你的地方字段。 使用ParseObject testObject = new ParseObject("locations"); 每次投入新价值之前:

//1 ParseObject testObject1 = new ParseObject("locations"); ParseGeoPoint point1 = new ParseGeoPoint(21.177051,79.061818); testObject1.put("placeName", "Brand Factory"); testObject1.put("address","Brand Factory,RKNEC,Nagpur"); testObject1.put("locationPoint", point1); testObject1.put("offers", "10% on Clothing"); testObject1.saveInBackground(); //2 ParseObject testObject2 = new ParseObject("locations"); ParseGeoPoint point2 = new ParseGeoPoint(21.177051,79.061818); testObject2.put("placeName", "G E"); testObject2.put("address","G E, RKNEC, Nagpur"); testObject2.put("locationPoint", point2); testObject2.put("offers", "20% on Shoes"); testObject2.saveInBackground()

I think Parse simple overwrite your place fields. Use ParseObject testObject = new ParseObject("locations"); every time before put new values:

//1 ParseObject testObject1 = new ParseObject("locations"); ParseGeoPoint point1 = new ParseGeoPoint(21.177051,79.061818); testObject1.put("placeName", "Brand Factory"); testObject1.put("address","Brand Factory,RKNEC,Nagpur"); testObject1.put("locationPoint", point1); testObject1.put("offers", "10% on Clothing"); testObject1.saveInBackground(); //2 ParseObject testObject2 = new ParseObject("locations"); ParseGeoPoint point2 = new ParseGeoPoint(21.177051,79.061818); testObject2.put("placeName", "G E"); testObject2.put("address","G E, RKNEC, Nagpur"); testObject2.put("locationPoint", point2); testObject2.put("offers", "20% on Shoes"); testObject2.saveInBackground()

更多推荐

本文发布于:2023-08-03 22:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1401095.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   数据库中   parse   database   added

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!