AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

jsonobject insert jsonobject
 
 

how to insert jsonobject to other jsonobject?

code

$$custobject=^jsoncreate(object) # json object create
$$productobject=^jsoncreate(object) # json object create

^jsonobjectinsert($$custobject name $custname)
^jsonobjectinsert($$custobject phone $custphone)
^jsonobjectinsert($$custobject addr $custaddr)
^jsonobjectinsert($$productobject product $product1)
^jsonobjectinsert($$custobject product $$productobject)

this code error….

 

 
  [ # 1 ]

jsonobjejct insert jsonobject complite!!

and json to string complite!!!

but mongodb insert faild…

this code…

$$noncustid=^join($custname $custphone)
$$custobject=^jsoncreate(object) # json object create
$$productobject=^jsoncreate(object) # json object create

^jsonobjectinsert($$custobject name $custname)
^jsonobjectinsert($$custobject phone $custphone)
^jsonobjectinsert($$custobject addr $custaddr)
^jsonobjectinsert($$productobject product $product1)
^jsonobjectinsert($$custobject product $$productobject)
   
   
$$noncustval=^jsonwrite($$custobject)

^mongoinit(mongodb://localhost:27017 test noncust)
^mongoinsertdocument($$noncustid $$noncustval)
^mongoclose()

 

 
  login or register to react