Elminating duplicates in a JSON object

前端 未结 2 1196
刺人心
刺人心 2020-12-16 16:10
[
  {
    \"lastName\": \"Seymour\",
    \"gender\": \"Female\",
    \"patientID\": 18134,
    \"firstName\": \"Stephanie\",
    \"age\": \"111Y\"
  },
  {
    \"las         


        
2条回答
  •  鱼传尺愫
    2020-12-16 16:48

    what is "contains this value"? do you mean, the two items have all the fields equal?

    in this case you may serialize to string (json) each item and compare the new one (serialized also) to the set of existing.

提交回复
热议问题