note = session.query(Notes).filter(
                Notes.bibcode == document_id,
                Notes.library_id == library_id