fryjordan commented on code in PR #1402: URL: https://github.com/apache/couchdb-fauxton/pull/1402#discussion_r1265365165
########## app/addons/documents/mango/components/MangoQueryCheatsheetModal.js: ########## @@ -0,0 +1,138 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +import React from 'react'; +import { Modal, Table } from 'react-bootstrap'; + +export default function MangoQueryCheatsheetModal({isVisible, onHide}) { + return <Modal dialogClassName="mango-cheatsheet-modal" show={isVisible}> + <Modal.Header closeButton={false}> + <Modal.Title>Query Cheatsheet</Modal.Title> + </Modal.Header> + <Modal.Body> + <div className='table-wrapper'> + + <Table striped> + <thead> + <tr> + <th>Condition Operator</th> + <th>Argument</th> + <th>Purpose</th> + </tr> + </thead> + <tbody> + <tr> + <td> + <code>$eq</code>, <code>$ne</code><br/> + <code>$lt</code>, <code>$lte</code><br/> + <code>$gt</code>, <code>$gte</code> + </td> + <td>Any JSON value</td> + <td> + Equal, Not equal<br/> + Lesser, Lesser or equal,<br/> + Greater, Greater or equal + </td> + </tr> + <tr> + <td><code>$exists</code></td> + <td>Boolean</td> + <td>Check field exists or not</td> + </tr> + <tr> + <td><code>$type</code></td> + <td>String</td> + <td>Check field type, accepts: <code>"null"</code>, <code>"boolean"</code>, + <code>"number"</code>, <code>"string"</code>, <code>"array"</code> and <code>"object"</code> + </td> + </tr> + <tr> + <td><code>$in</code>, <code>$nin</code></td> + <td>Array of JSON values</td> + <td>Field must exist / not exist</td> + </tr> + <tr> + <td><code>$size</code></td> + <td>Integer</td> + <td>Match length of an array field</td> + </tr> + <tr> + <td><code>$mod</code></td> + <td>[Divisor, Remainder]</td> + <td>Matches <pre>field % Divisor == Remainder</pre></td> + </tr> + <tr> + <td><code>$regex</code></td> + <td>String</td> + <td>String value matches a regex</td> + </tr> + </tbody> + </Table> + <br/> + <Table striped> + <thead> + <tr> + <th>Combination Operators</th> + <th>Argument</th> + <th>Purpose</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>$and</code></td> + <td>Array</td> + <td>Matches if ALL the selectors in the array match</td> + </tr> + <tr> + <td><code>$or</code></td> + <td>Array</td> + <td>Matches if ANY the selectors in the array match</td> Review Comment: ```suggestion <td>Matches if ANY of the selectors in the array match</td> ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
