This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": { | |
"bool": { | |
"must": { | |
Leaf query clauses - affects the scoring of matching documents | |
}, | |
"must_not" : { | |
Leaf query clauses - affects the scoring of matching documents | |
}, | |
"should" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": { | |
"bool": { | |
"filter": [ | |
{ | |
"term": { "gender": "female" } | |
}, | |
{ | |
"range": { "age": {"gte":"50"} } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": { | |
"term": { | |
"mail_from": "emma@somemail.com" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": { | |
"bool": { | |
"must": { | |
"match": { | |
"mail_body": "Jeff BRidges" | |
} | |
}, | |
"filter": { | |
"term": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": { | |
"match": { | |
"mail_body": "Jeff BRidges" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import FormContext from "./FormContext"; | |
class FormField extends React.Component { | |
async componentDidMount() { | |
let { name, validators = [] } = this.props; | |
const { validateField, getFieldValue } = this.context; | |
// set default value | |
const newValue = getFieldValue({ name }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Fragment } from "react"; | |
export default props => { | |
const { | |
onChange, | |
validateField, | |
value, | |
error, | |
name, | |
validationText, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Author { | |
firstName: string; | |
lastName: string; | |
} | |
export class Genre { | |
name: string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export abstract class IGenericRepository<T> { | |
abstract getAll(): Promise<T[]>; | |
abstract get(id: string): Promise<T>; | |
abstract create(item: T): Promise<T>; | |
abstract update(id: string, item: T); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Author, Book, Genre } from '../entities'; | |
import { IGenericRepository } from './generic-repository.abstract'; | |
export abstract class IDataServices { | |
abstract authors: IGenericRepository<Author>; | |
abstract books: IGenericRepository<Book>; | |
abstract genres: IGenericRepository<Genre>; | |
} |