implemented @limit for search

This commit is contained in:
zadam
2019-04-22 18:08:33 +02:00
parent 15eaf67189
commit f273b4334e
8 changed files with 251 additions and 40 deletions

View File

@@ -127,10 +127,24 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} searchString
* @returns ${Promise<Note[]>}
* @returns {Promise<Note[]>}
*/
this.searchForNotes = searchService.searchForNotes;
/**
* This is a powerful search method - you can search by attributes and their values, e.g.:
* "@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
*
* @method
* @param {string} searchString
* @returns {Promise<Note|null>}
*/
this.searchForNote = async searchString => {
const notes = await searchService.searchForNotes(searchString);
return notes.length > 0 ? notes[0] : null;
};
/**
* Retrieves notes with given label name & value
*