def getByTime(self, startTime=None, endTime=None):
        """
            :desc: Get all the notes in the given time window
            :param int startTime: The begining of the window
            :param int endTime: The end of the window
            :returns: A list of IDs
            :ravl: list
        """
        collections = self.get_data_collections()

        if startTime is not None:
            startTime = float(startTime)
        if endTime is not None:
            endTime = float(endTime)

        if startTime is not None and endTime is not None:
            timeQuery = {"$and": [{"timestamps": {"$gt": startTime}},
                                  {"timestamps": {"$lt": endTime}}]}
        elif startTime is not None and endTime is None:
            timeQuery = {"timestamps": {"$gt": startTime}}
        elif startTime is None and endTime is not None:
            timeQuery = {"timestamps": {"$lt": endTime}}

        IDs = []

        for coll in collections:
            docs = self.noteDB[coll].find(timeQuery, {"ID": 1, "_id": 0})
            for doc in docs:
                IDs.append(doc['ID'])

        return IDs