     if result[0].hasItems.length > 0
       for itemIds in result[0].hasItems
         db.collection('item').find({'_id':database.getId(itemIds)}).toArray (err, result) ->
-          console.log result[0]
           currentItem = new item.item result[0]._id, result[0].name, result[0].status, result[0].type, result[0].link, result[0].description, result[0].date, result[0].technologies, result[0].images
           db.collection('item').update {'_id':database.getId(result[0]._id)}, currentItem
       db.collection('collection').remove {'_id':database.getId(req.body.id)}, ->

  db.collection('collection').insert newCollection, ->
    res.redirect 'back'

router.post '/getItem', (req, res, next) ->
  db = database.getDb()
  db.collection('item').find({'_id':database.getId(req.body.id)}).toArray (err, result) ->

    if req.body.collection
      db.collection('collection').find({'_id':database.getId(req.body.collection)}).toArray (err, result) ->
        currentCollection = new item.collection result[0]._id, result[0].name, result[0].status, result[0].type, result[0].link, result[0].description, result[0].image, result[0].hasItems
        editedItem.setCollection currentCollection
        db.collection('collection').update {'_id':database.getId(req.body.collection)}, currentCollection, ->
          db.collection('item').update {'_id':database.getId(req.params.id)}, editedItem, ->
