code: func (mc MongoClient) DeleteCommandById(id string) error {
  	s := mc.session.Copy()
  	defer s.Close()
  	col := s.DB(mc.database.Name).C(db.Command)
  
  	// Check if the command is still in use
  	findParameters, err := idToBsonM(id)
  	if err != nil {
  		return err
  	}
  	query := bson.M{"commands": bson.M{"$elemMatch": findParameters}}
  	count, err := s.DB(mc.database.Name).C(db.DeviceProfile).Find(query).Count()
  	if err != nil {
  		return errorMap(err)
  	}
  	if count > 0 {
  		return db.ErrCommandStillInUse
  	}
  
  	// remove the command
  	n, v, err := idToQueryParameters(id)
  	if err != nil {
  		return err
  	}
  	return errorMap(col.Remove(bson.D{{Name: n, Value: v}}))
  }
docs: // Delete the command by ID
  // Check if the command is still in use by device profiles