New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom schema remember previous value #30
Comments
I had the same problem. I did everything but nothing yet... Tnks |
Sorry about the delay. Could you please post the full code of what you're doing (including express middleware)? |
In my case this is my express config: module.exports = function (config, arrayDB) {
const app = express()
app.set('port', config.port)
app.use(helmet())
app.use(cors())
app.use(bodyParser.urlencoded({
extended: true
}))
app.use(bodyParser.json())
app.use(methodOverride())
app.set('secretKey', config.secretKey)
app.use(express.static('public'))
app.use((req, res, next) => {
debug(req.method + ' - ' + req.url)
next()
})
app.set('sqlConnectorOperacional', arrayDB[0])
app.set('sqlConnectorFinanceiro', arrayDB[1])
load('models')
.then('controllers')
.then('routes')
.into(app)
return app
} and this is a route where I use querymen: const querymen = require('querymen')
module.exports = function (app) {
const controller = app.controllers.relatorio
let logSchema = {
limit: 100,
sort: '-created_on',
codigo: Number,
find: {
type: RegExp,
paths: [
'operacao',
'usuario.nome',
'usuario.email',
'relatorio.cartao.cpf',
'relatorio.cartao.matricula'
],
bindTo: 'query'
},
after: {
type: Date,
paths: [ 'created_on' ],
operator: '$gte'
},
before: {
type: Date,
paths: [ 'created_on' ],
operator: '$lte'
}
}
// Log
app.route('/api/relatorio/log')
.get(querymen.middleware(logSchema), controller.list)
} |
@isaacvitor I can't reproduce it. What exactly is happening? Is this happening with all schema parameters? It would be nice to have a minimum repo with a reproduction. |
@diegohaz you're right, really you would cannot reproduce it. Unfortunately I can't put it in a repo. |
I also faced with the same issue. I will try to prepare a small repo with example |
Have the same issue here. |
I have the same problem, has anyone solved the problem? I will try to review the source code to see if I can fix it. |
Solved problem described in diegohaz#30
I solved this problem in #47 |
Hi guys, I have solved this issue with this pull request, and all the test is passing ;) |
Check PR #52 , you might find workarounds there and further discussion. |
Hi:
I'm using a custom schema like this
If I made a request like this:
myurl.com/stores/?store=amazon, everithing is ok, but if I made a request after, but without any params: myurl.com/stores/, for some reason i keep getting this { store: /amazon/i } in my query
Is there a way to fix this behavior? or maybe I'm missing somethings.
best regards.
The text was updated successfully, but these errors were encountered: