Menu

getDocumentsByKey

Help
Robert
2012-02-01
2013-04-25
  • Robert

    Robert - 2012-02-01

    Hi,
    I want to get a field called for instance 'name' in certain document using a key, the view is already sorted using that key and both the key and the field I want are indexed and I am using this formula wich does not return any value but doesn't return an error either

    key = plominoContext.field1
    db=plominoDocument.getParentDatabase() 
    view=db.getView("allDocs") 
    for d in view.getDocumentsByKey(key):
        name=d.name
        return name
    

    I checked the view and the document exists and the field 'name' has a value too.  But I cannot figure out what could it because I have the same formula in another database an works fine.

    Thanks.

     
  • Eric Brehault

    Eric Brehault - 2012-02-10

    Note: Please use GitHub now https://github.com/plomino/Plomino/issues

    you have indented the return line, so your loop stops at the first doc

     

Log in to post a comment.