findOne passing primary key with join returns array
Summary
findOne returns an array when a primary key is passed and it's called with a join
Example
Code demonstrating the behavior
db.orders.findOne({id: orderId}); // returns an object
db.orders.findOne(orderId); // returns an object
db.orders
.join({
orderLines: {
relation: 'orderLines',
type: 'LEFT OUTER',
},
})
.findOne({id: orderId}); // returns an object
db.orders
.join({
orderLines: {
relation: 'orderLines',
type: 'LEFT OUTER',
},
})
.findOne(orderId); // returns an array
Expected behavior
Passing a primary key with a join should return an object. Passing the primary key should have the same behavior as passing a criteria object with id.
Additional context
Using Massive 6.9.0
Edited by Darrin Grove