You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
query(fromDB(db),where(equal(seekType,'post',{indexType: 'type'})),toCallback((err,msgs)=>{console.log('There are '+msgs.length+' messages of type "post"')}))// The `seekType` function takes a buffer and uses `bipf` APIs to search for// the fields we want.constbValue=Buffer.from('value')// better for performance if defined outsideconstbContent=Buffer.from('content')constbType=Buffer.from('type')functionseekType(buffer){varp=0// p stands for "position" in the buffer, offset from startp=bipf.seekKey(buffer,p,bValue)if(p<0)returnp=bipf.seekKey(buffer,p,bContent)if(p<0)returnreturnbipf.seekKey(buffer,p,bType)}
Including some higher level text would help me understand this I think. What is the seekType function doing here? It could be good to include an example using 'real' fields in messages, instead of 'value', 'content', and 'type' like above
thanks
The text was updated successfully, but these errors were encountered:
The readme includes this example
Including some higher level text would help me understand this I think. What is the
seekType
function doing here? It could be good to include an example using 'real' fields in messages, instead of 'value', 'content', and 'type' like abovethanks
The text was updated successfully, but these errors were encountered: