PHP-DB - Php and mongodb synchronization

Discussion in 'PHP' started by Deepprogrammer, Nov 1, 2012.

  1. #1
    Hi,
    I have a website with volunteers that help to translate the website to other languages.
    I am working with php along with Mongodb ,
    how can I sync a collection update ?
    for example :
    2 volunteers wants to update the same record in a collection and enter in the same time .. they are both see the same translation now .. if someone has update the record while the other one is still working .. I want to prevent the other from updating and ruin the previous update made the the first user .
    thanks ahead
     
    Deepprogrammer, Nov 1, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Lock the record if someone opens it for writing. You can't have two people updating one record at the same time.
     
    Rukbat, Nov 2, 2012 IP