1 | <!DOCTYPE html>
|
2 | <html lang="en">
|
3 | <head>
|
4 | <meta charset="utf-8">
|
5 | <title>JSDoc: Source: lib/model/search/match.js</title>
|
6 |
|
7 | <script src="scripts/prettify/prettify.js"> </script>
|
8 | <script src="scripts/prettify/lang-css.js"> </script>
|
9 | |
10 |
|
11 |
|
12 | <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
13 | <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
14 | </head>
|
15 |
|
16 | <body>
|
17 |
|
18 | <div id="main">
|
19 |
|
20 | <h1 class="page-title">Source: lib/model/search/match.js</h1>
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | <section>
|
28 | <article>
|
29 | <pre class="prettyprint source linenums"><code>var util = require('./util');
|
30 |
|
31 | /**
|
32 | {
|
33 | "match": true,
|
34 | "matchfield": "channels.name.current-value",
|
35 | "matchstring": "Peter Jo*",
|
36 |
|
37 | options.match : {
|
38 | channel: '',
|
39 | string: ''
|
40 | }
|
41 |
|
42 | }
|
43 | */
|
44 | module.exports = function (params, query) {
|
45 | if(!params) return;
|
46 |
|
47 | query.match = true;
|
48 | query.matchfield = util.getFieldName(params);
|
49 |
|
50 | var hasString = util.hasProp(params, "string");
|
51 |
|
52 | if(!hasString) {
|
53 | throw new Error("A value for `string` property has to be provided for text based search");
|
54 | }
|
55 |
|
56 | query.matchstring = params.string;
|
57 | };
|
58 | </code></pre>
|
59 | </article>
|
60 | </section>
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | </div>
|
66 |
|
67 | <nav>
|
68 | <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Action.html">Action</a></li><li><a href="Channel.html">Channel</a></li><li><a href="Client.html">Client</a></li><li><a href="Raptor.html">Raptor</a></li><li><a href="RecordSet.html">RecordSet</a></li><li><a href="ResultSet.html">ResultSet</a></li><li><a href="ServiceObject.html">ServiceObject</a></li><li><a href="Stream.html">Stream</a></li><li><a href="User.html">User</a></li></ul><h3>Global</h3><ul><li><a href="global.html#Container">Container</a></li></ul>
|
69 | </nav>
|
70 |
|
71 | <br class="clear">
|
72 |
|
73 | <footer>
|
74 | Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Wed Nov 02 2016 11:15:06 GMT+0100 (CET)
|
75 | </footer>
|
76 |
|
77 | <script> prettyPrint(); </script>
|
78 | <script src="scripts/linenumber.js"> </script>
|
79 | </body>
|
80 | </html>
|