Initial implementation for the note database querying