Need Unique value

47 views
Skip to first unread message

ramkart...@gmail.com

unread,
Jul 20, 2016, 4:27:45 AM7/20/16
to OrientDB
Hi Sir,
 
    I need multiple ordered auto generated unique value for same vertex.

EX: 

  vertex (Student)

  @rid     name       id        class_id(edge)

  #10:0    John1       0          #12:1
  #10:1    John2       0           #12:2
  #10:2    John3       1          #12:1
  #10:3    John4       1          #12:2
  #10:4    John5       2          #12:1
  #10:5    John6       3          #12:1
  #10:3    John7       2          #12:2
 
 Please help me its urgent need.

Thanks,
 Ram


alessand...@gmail.com

unread,
Jul 20, 2016, 4:55:21 AM7/20/16
to OrientDB
Hi,
could you explain better your structure and what you want ?

Best regards,
Alessandro

ramkart...@gmail.com

unread,
Jul 20, 2016, 5:16:29 AM7/20/16
to OrientDB
okay sir,

      I build cloud based spa billing application and used to orientdb 2.0.18 version database. many spas(stores) to signed with my software, every store billing information to stored single vertex name as (billing) and have edge from store to billing.   
  
     my need is each store need a ordered bill number, how can create ordered bill number in single vertex on orientdb.

EX: 

  vertex (billing)

  @rid     name       id        in('store_has_billing')

  #10:0    John1       1          #12:1
  #10:1    John2       2          #12:1
  #10:2    John3       3          #12:1
  #10:3    John4       1          #12:2
  #10:4    John5       2          #12:2
  #10:5    John6       3          #12:2
  #10:3    John7       4          #12:2

alessand...@gmail.com

unread,
Jul 20, 2016, 6:52:27 AM7/20/16
to OrientDB
Hi,
I created this graph


I used this function 

var g=orient.getGraph();
var b=g.command("sql","select out('store_has_billing') as my_out from store");
for(i=0;i<b.length;i++){
 
var my_out=b[i].getProperty("my_out");
       
var m=my_out.iterator();
  j
=0;
 
while(m.hasNext()){
 
var bill = m.next();
              bill
.setProperty("myId",++j);
 
}
}



Hope it helps.


ramkart...@gmail.com

unread,
Jul 22, 2016, 5:18:39 AM7/22/16
to OrientDB
Thank you....
Reply all
Reply to author
Forward
0 new messages